import request from '@/config/axios'

export interface DutyVO {
  id?: number
  name: string
  sort: number
  status: number
  remark: string
  createTime?: Date
}

// 查询职务列表
export const getDutyPage = async (params: PageParam) => {
  return await request.get({ url: '/system/duty/page', params })
}

// 获取职务精简信息列表
export const getSimpleDutyList = async (): Promise<DutyVO[]> => {
  return await request.get({ url: '/system/duty/simple-list' })
}

// 查询职务详情
export const getDuty = async (id: number) => {
  return await request.get({ url: '/system/duty/get?id=' + id })
}

// 新增职务
export const createDuty = async (data: DutyVO) => {
  return await request.post({ url: '/system/duty/create', data })
}

// 修改职务
export const updateDuty = async (data: DutyVO) => {
  return await request.put({ url: '/system/duty/update', data })
}

// 删除职务
export const deleteDuty = async (id: number) => {
  return await request.delete({ url: '/system/duty/delete?id=' + id })
}

// 导出职务
export const exportDuty = async (params) => {
  return await request.download({ url: '/system/duty/export', params })
}
