39 lines
883 B
TypeScript
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>)
|
|
}
|