Task description
- 获取图书数据表结构:https://open-source-bazaar.feishu.cn/wiki/KAGewsUUQiAnEokHAcHcTkz6n1b?table=tblm8grig3e36tsC&view=vewCidA31M
- 参考 07fe075 对接其后端 API:
|
export const getServerSideProps: GetServerSideProps<Book> = async ({ params }) => { |
|
const bookId = +(params!.id + ''); |
|
|
|
const { body } = await larkClient.get<Book[]>(`${API_Host}/api/open-library/books`); |
|
|
|
const book = body!.find(({ id }) => id === bookId); |
|
|
|
return book ? { props: book } : { notFound: true }; |
|
}; |
- 将图书数据模型类声明在此:
|
export class SystemModel extends BaseModel { |
|
searchMap = { |
|
activity: SearchActivityModel, |
|
project: SearchProjectModel, |
|
award: SearchAwardModel, |
|
NGO: SearchOrganizationModel, |
|
} as Record<string, Constructor<SearchModel<DataObject>>>; |
- 将图书卡片组件声明在此:
|
const SearchNameMap = ({ t }: typeof i18n): Record<string, string> => ({ |
|
activity: t('activity'), |
|
project: t('open_source_projects'), |
|
NGO: t('NGO'), |
|
}); |
|
|
|
const SearchCardMap: Record<string, CardPageProps['Card']> = { |
|
activity: ActivityCard, |
|
project: ProjectCard, |
|
NGO: OrganizationCard, |
|
}; |
Reward currency
TQT $
Reward amount
90
Reward payer
水歌 tech-query@fcc-cd.dev
Task source
https://open-source-bazaar.feishu.cn/record/HrTcrlZ83eVFYUc2fsFceZjKnob
Task description
Open-Source-Bazaar.github.io/pages/open-library/book/[id].tsx
Lines 19 to 27 in 4a182f8
Open-Source-Bazaar.github.io/models/System.ts
Lines 24 to 30 in 4a182f8
Open-Source-Bazaar.github.io/pages/search/[model]/index.tsx
Lines 42 to 52 in 4a182f8
Reward currency
TQT $
Reward amount
90
Reward payer
水歌 tech-query@fcc-cd.dev
Task source
https://open-source-bazaar.feishu.cn/record/HrTcrlZ83eVFYUc2fsFceZjKnob