Files
smartserve-client/frontend/src/api/knowledgeCards.ts
xie2can 34e52ab1d0 feat: 新增知识卡片页面及路由支持
- 添加知识卡片 API 接口与 Mock 数据
- 实现知识卡片列表展示与筛选功能
- 实现知识卡片详情抽屉
- 支持路由嵌套配置与菜单展开
2026-05-27 19:46:05 +08:00

39 lines
883 B
TypeScript

import { get } from '@/utils/request'
export type KnowledgeCardType = 'global' | 'product' | 'chat'
export type KnowledgeCardAuditStatus = 'pending' | 'approved'
export interface RelatedProduct {
id: number
name: string
}
export interface RelatedChat {
id: number
name: string
}
export interface KnowledgeCard {
id: number
title: string
content: string
type: KnowledgeCardType
auditStatus: KnowledgeCardAuditStatus
author: string
updatedAt: string
coverColor: string
tags: string[]
relatedProducts: RelatedProduct[]
relatedChats: RelatedChat[]
}
export interface GetKnowledgeCardsParams {
type?: KnowledgeCardType
auditStatus?: KnowledgeCardAuditStatus
}
/** 获取知识卡片列表 */
export function getKnowledgeCards(params?: GetKnowledgeCardsParams) {
return get<KnowledgeCard[]>('/knowledge/cards', params as Record<string, string>)
}