Skip to content

对接【开源图书馆】飞书多维表格 API #96

Description

@TechQuery

Task description

  1. 获取图书数据表结构:https://open-source-bazaar.feishu.cn/wiki/KAGewsUUQiAnEokHAcHcTkz6n1b?table=tblm8grig3e36tsC&view=vewCidA31M
  2. 参考 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 };
    };
  3. 将图书数据模型类声明在此:
    export class SystemModel extends BaseModel {
    searchMap = {
    activity: SearchActivityModel,
    project: SearchProjectModel,
    award: SearchAwardModel,
    NGO: SearchOrganizationModel,
    } as Record<string, Constructor<SearchModel<DataObject>>>;
  4. 将图书卡片组件声明在此:
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions