import request from '@/config/axios'

// 门墩儿-企业用户申请 VO
export interface EnterpriseUserApplyVO {
  id: number // id
  userId: number // 用户id
  enterpriseId: number // 所属企业id
  postId: number // 企业岗位id
  name: string // 申请人姓名
  status: string // 审核状态（0审核中 1审核通过 2审核不通过）
  reason: string // 审核原因
  remark: string // 备注
}

export interface EnterpriseRegisterPageVO {
  id: number // id
  reason: string // 审核原因
}
// 门墩儿-企业用户申请 API
export const EnterpriseUserApplyApi = {
  // 查询门墩儿-企业用户申请分页
  getEnterpriseUserApplyPage: async (params: any) => {
    return await request.get({ url: `/menduner/system/enterprise-user-apply/page`, params })
  },

  // 查询门墩儿-企业用户申请详情
  getEnterpriseUserApply: async (id: number) => {
    return await request.get({ url: `/menduner/system/enterprise-user-apply/get?id=` + id })
  },

  // 新增门墩儿-企业用户申请
  createEnterpriseUserApply: async (data: EnterpriseUserApplyVO) => {
    return await request.post({ url: `/menduner/system/enterprise-user-apply/create`, data })
  },

  // 修改门墩儿-企业用户申请
  updateEnterpriseUserApply: async (data: EnterpriseUserApplyVO) => {
    return await request.put({ url: `/menduner/system/enterprise-user-apply/update`, data })
  },

  // 删除门墩儿-企业用户申请
  deleteEnterpriseUserApply: async (id: number) => {
    return await request.delete({ url: `/menduner/system/enterprise-user-apply/delete?id=` + id })
  },

  // 导出门墩儿-企业用户申请 Excel
  exportEnterpriseUserApply: async (params) => {
    return await request.download({ url: `/menduner/system/enterprise-user-apply/export-excel`, params })
  },

  // 门墩儿-企业用户申请 通过
  passEnterpriseRegister: async (data: EnterpriseRegisterPageVO) => {
    return await request.put({ url: `/menduner/system/enterprise-user-apply/approved`, data })
  },

  // 门墩儿-企业用户申请 拒绝
  rejectEnterpriseRegister: async (data: EnterpriseRegisterPageVO) => {
    return await request.put({ url: `/menduner/system/enterprise-user-apply/reject`, data })
  }
}