import request from '@/config/axios'

// 门墩儿-招聘职位 VO
export interface JobAdvertisedVO {
  id: number // id
  areaId: number // 工作地区
  name: string // 职位名称
  positionId: number // 职位类型id
  type: number // 招聘类型
  expType: number // 工作经验
  eduType: number // 学历要求
  payUnit: number // 计薪时段
  payFrom: number // 薪酬from
  payTo: number // 薪酬to
  tagList: Array<[]> // 职位标签
  content: string // 职位内容
  requirement: string // 职位要求
  address: string // 工作地址
  longitude: string // 经度
  latitude: string // 维度
  expireTime: string // 过期时间
}

// 门墩儿-招聘职位 API
export const JobAdvertisedApi = {
  // 查询门墩儿-招聘职位分页
  getJobAdvertisedPage: async (params: any) => {
    return await request.get({ url: `/menduner/system/job-advertised/page`, params })
  },

  // 查询门墩儿-招聘职位详情
  getJobAdvertised: async (id: number) => {
    return await request.get({ url: `/menduner/system/job-advertised/get?id=` + id })
  },

  // 新增门墩儿-招聘职位
  createJobAdvertised: async (data: JobAdvertisedVO) => {
    return await request.post({ url: `/menduner/system/job-advertised/create`, data })
  },

  // 关闭门墩儿-招聘职位
  closeJobAdvertised: async (ids) => {
    return await request.post({ url: `/menduner/system/job-advertised/disable?ids=` + ids })
  },

  // 激活门墩儿-招聘职位
  enAbleJobAdvertised: async (ids) => {
    return await request.post({ url: `/menduner/system/job-advertised/enable?ids=` + ids })
  },

  // 修改门墩儿-招聘职位
  updateJobAdvertised: async (data: JobAdvertisedVO) => {
    return await request.put({ url: `/menduner/system/job-advertised/update`, data })
  },

  // 删除门墩儿-招聘职位
  deleteJobAdvertised: async (id: number) => {
    return await request.delete({ url: `/menduner/system/job-advertised/delete?id=` + id })
  },

  // 导出门墩儿-招聘职位 Excel
  exportJobAdvertised: async (params) => {
    return await request.download({ url: `/menduner/system/job-advertised/export-excel`, params })
  },

  // 查询职位模板
  getRecruitPositionDetails: async (id) => {
    return await request.get({ url: `/menduner/system/position/get?id=` + id })
  },
}