import request from '@/config/axios'

// 行业信息 VO
export interface IndustryVO {
  id: number // id
  nameCn: string // 行业中文名称
  nameEn: string // 行业英文名称
  parentId: number // 上级id
  level: boolean // 层级
}

// 行业信息 API
export const IndustryApi = {
  // 查询行业信息列表
  getIndustryList: async (params) => {
    return await request.get({ url: `/menduner/system/industry/list`, params })
  },

  // 查询行业信息详情
  getIndustry: async (id: number) => {
    return await request.get({ url: `/menduner/system/industry/get?id=` + id })
  },

  // 新增行业信息
  createIndustry: async (data: IndustryVO) => {
    return await request.post({ url: `/menduner/system/industry/create`, data })
  },

  // 修改行业信息
  updateIndustry: async (data: IndustryVO) => {
    return await request.put({ url: `/menduner/system/industry/update`, data })
  },

  // 删除行业信息
  deleteIndustry: async (id: number) => {
    return await request.delete({ url: `/menduner/system/industry/delete?id=` + id })
  },

  // 导出行业信息 Excel
  exportIndustry: async (params) => {
    return await request.download({ url: `/menduner/system/industry/export-excel`, params })
  }
}