import request from '@/config/axios'

export interface TagVO {
  id: number
  nameCn: string
  nameEn: string
  type: string
  parentId: number
  level: number
}

// 查询标签管理列表
export const getTagPage = async (params) => {
  return await request.get({ url: '/menduner/system/tag/list', params })
}

// 查询标签管理详情
export const getTag = async (id: number) => {
  return await request.get({ url: '/menduner/system/tag/get?id=' + id })
}

// 新增标签管理
export const createTag = async (data: TagVO) => {
  return await request.post({ url: '/menduner/system/tag/create', data })
}

// 修改标签管理
export const updateTag = async (data: TagVO) => {
  return await request.put({ url: '/menduner/system/tag/update', data })
}

// 删除标签管理
export const deleteTag = async (id: number) => {
  return await request.delete({ url: '/menduner/system/tag/delete?id=' + id })
}

// 导出标签管理 Excel
export const exportTagApi = async (params) => {
  return await request.download({ url: '/menduner/system/tag/export-excel', params })
}