import request from '@/config/axios'

// AI 知识库 VO
export interface KnowledgeVO {
  id: string
  // TODO: Add other fields based on your data model
}

// AI 知识库 API
export const KnowledgeApi = {
  // 获得知识库列表
  getKnowledgeList: async (params: any) => {
    return await request.get({ url: '/chat/aigc/knowledge/list', params })
  },

  // 获得知识库分页
  getKnowledgePage: async (params: any) => {
    return await request.get({ url: '/chat/aigc/knowledge/page', params })
  },

  // 获得知识库详情
  getKnowledge: async (id: string) => {
    return await request.get({ url: `/chat/aigc/knowledge/${id}` })
  },

  // 创建知识库
  createKnowledge: async (data: any) => {
    return await request.post({ url: '/chat/aigc/knowledge', data })
  },

  // 更新知识库
  updateKnowledge: async (data: any) => {
    return await request.put({ url: '/chat/aigc/knowledge', data })
  },

  // 删除知识库
  deleteKnowledge: async (id: string) => {
    return await request.delete({ url: `/chat/aigc/knowledge/${id}` })
  }
}