generated from tailored/router-db-template
- Changed Bailian model from 'qwen3-235b-a22b' to 'qwen-plus' in ai.ts - Updated model references in bailianModel to use simplified names - Modified tsconfig.json to set module to NodeNext, target to esnext, and adjusted paths for better module resolution - Added new query-keys.ts file in xhs package to implement getNoteByKeyword functionality with command line interface
57 lines
1.1 KiB
TypeScript
57 lines
1.1 KiB
TypeScript
type ApiInfo = {
|
|
uri: string;
|
|
method?: 'GET' | 'POST';
|
|
needSign?: boolean;
|
|
description?: string;
|
|
isCreator?: boolean;
|
|
};
|
|
export const api: ApiInfo[] = [
|
|
{
|
|
uri: '/api/sns/web/v1/you/mentions',
|
|
method: 'GET',
|
|
description: '获取@我的消息',
|
|
},
|
|
{
|
|
uri: '/api/sns/web/v1/you/likes',
|
|
method: 'GET',
|
|
description: '获取点赞的消息',
|
|
},
|
|
{
|
|
uri: '/api/sns/web/v1/you/connections',
|
|
method: 'GET',
|
|
description: '获取关注的消息',
|
|
needSign: true,
|
|
},
|
|
{
|
|
uri: '/api/sns/web/v1/you/mentions',
|
|
method: 'GET',
|
|
needSign: true,
|
|
description: '获取@我的消息',
|
|
},
|
|
{
|
|
uri: '/api/sns/web/v1/search/notes',
|
|
method: 'POST',
|
|
needSign: true,
|
|
description: '通过关键词搜索笔记',
|
|
}
|
|
];
|
|
|
|
type ReturnApiInfo = {
|
|
apiInfo: ApiInfo;
|
|
needSign: boolean;
|
|
};
|
|
export const getApiInfo = (uri: string): ReturnApiInfo | null => {
|
|
const apiInfo = api.find((item) => item.uri?.startsWith(uri));
|
|
if (apiInfo) {
|
|
return {
|
|
apiInfo,
|
|
needSign: apiInfo.needSign ?? true,
|
|
};
|
|
} else {
|
|
}
|
|
return {
|
|
apiInfo: null,
|
|
needSign: true,
|
|
};
|
|
};
|