import { http } from '@/http/http'
enum Api {
  baseknowledgeCategory = '/knowledgeCategory/category',
  queryknowledgeCategory = '/knowledgeCategory/category/list',
  queryknowledgeTableContents = '/knowledgeContent/content/list',
  baseknowledgeContent = '/knowledgeContent/content',
  querycomment = '/commComments/comments/list',
  baseaddcomment = '/commComments/comments',
  queryrecord = '/knowledgeViewRecord/record/list',
  queryrecentviewlist = '/knowledgeContent/content/getRecentRecords',
}

//查询知识库分类列表
export function queryKnowledgeCategory(params: any) {
  return http.get(Api.queryknowledgeCategory, params)
}
//获取知识库内容目录列表
export function queryKnowledgeContentlist({ categoryId }) {
  return http.get(`${Api.queryknowledgeTableContents}/${categoryId}`)
}
//获取知识库内容详细信息
export function getKnowledgeContentDetail({ roleId }) {
  return http.get(`${Api.baseknowledgeContent}/${roleId}`)
}
//获取评论列表
export function querycomment({ targetId, targetType }: any) {
  return http.get(
    `${Api.querycomment}?targetId=${targetId}&targetType=${targetType}`
  )
}
//新增 提交评论
export function addComment(data: any) {
  return http.post(Api.baseaddcomment, data)
}
//查看记录
export function queryrecord(params: any) {
  return http.get(Api.queryrecord, params);
}
//最近查看列表
export function queryrecentviewlistAPI(params: any) {
  return http.get(Api.queryrecentviewlist, params);
}