import request from '@/config/axios'

// 门墩儿-企业注册申请 VO
export interface EnterpriseRegisterVO {
  id: number // id
  userId: number // 用户id
  name: string // 企业名称
  phone: string // 联系电话
  email: string // 联系邮箱
  businessLicenseUrl: string // 营业执照图片
  status: number // 帐号状态（0正常 1停用 2 等待审核 3不通过）
  reason: string // 审核原因
  remark: string // 备注
}

export interface EnterpriseRegisterPageVO {
  id: number // id
  reason: string // 审核原因
}

// 门墩儿-企业注册申请 API
export const EnterpriseRegisterApi = {
  // 查询门墩儿-企业注册申请分页
  getEnterpriseRegisterPage: async (params: any) => {
    return await request.get({ url: `/menduner/system/enterprise-register/page`, params })
  },

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

  // 新增门墩儿-企业注册申请
  createEnterpriseRegister: async (data: EnterpriseRegisterVO) => {
    return await request.post({ url: `/menduner/system/enterprise-register/create`, data })
  },

  // 修改门墩儿-企业注册申请
  updateEnterpriseRegister: async (data: EnterpriseRegisterVO) => {
    return await request.put({ url: `/menduner/system/enterprise-register/update`, data })
  },

  // 删除门墩儿-企业注册申请
  deleteEnterpriseRegister: async (id: number) => {
    return await request.delete({ url: `/menduner/system/enterprise-register/delete?id=` + id })
  },

  // 导出门墩儿-企业注册申请 Excel
  exportEnterpriseRegister: async (params) => {
    return await request.download({ url: `/menduner/system/enterprise-register/export-excel`, params })
  },

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

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