import request from '@/utils/request'
import query from "@/views/ecw/customer/query";

// 创建用户
export function createUser(data) {
  return request({
    url: '/member/user/create',
    method: 'post',
    data: data
  })
}

// 更新用户
export function updateUser(data) {
  return request({
    url: '/member/user/update',
    method: 'put',
    data: data
  })
}

// 删除用户
export function deleteUser(id) {
  return request({
    url: '/member/user/delete?id=' + id,
    method: 'delete'
  })
}

// 获得用户
export function getUser(id) {
  return request({
    url: '/member/user/get?id=' + id,
    method: 'get'
  })
}

// 获得用户分页
export function getUserPage(params) {
  return request({
    url: '/member/user/page',
    method: 'get',
    params: params
  })
}
 export function getWaitApprovePage(params){
  return request({
    url:'/member/user/waitApprovePage',
    method:'get',
    params
  })
}

// 导出用户 Excel
export function exportUserExcel(query) {
  return request({
    url: '/member/user/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

//操作日志
export function operationLogApi(query) {
  return request({
    url: '/member/user/operation-log/page',
    method: 'get',
    params: query,
  })
}

//更新证书
export function seTupdateBackletter(data) {
  return request({
    url: '/member/user/update-backletter',
    method: 'put',
    data: data

  })
}

//获取指定用户的实名认证信息
export function memberGetAuthIdcardInfo(query) {
  return request({
    url: '/member/user/get-auth-idcard-info',
    method: 'get',
    params: query,
  })
}

//获取指定企业认证信息
export function memberGetAuthEnterpriseInfo(query) {
  return request({
    url: '/member/user/get-auth-enterprise-info',
    method: 'get',
    params: query,
  })
}

//身份证审核
export function memberUserAuditIdCard(query) {
  return request({
    url: '/member/user/audit-idcard',
    method: 'put',
    data: query,
  })
}

//企业认证审核
export function memberUserAuditEnterprise(query) {
  return request({
    url: '/member/user/audit-enterprise',
    method: 'put',
    data: query,
  })
}

//修改身份证
export function memberUserUpdateIdCard(data) {
  return request({
    url: '/member/user/update-idcard',
    method: 'put',
    data: data
  })
}

// 修改企业
export function memberUserUpdateEnterprise(data) {
  return request({
    url: '/member/user/update-enterprise',
    method: 'put',
    data: data,
  })
}

//修改状态
export function setUserUpdateStatus(data) {
  return request({
    url:'/member/user/update-status',
    method:'put',
    data:data,
  })
}
//新增企业
export function userCreateAuditEnterprise(data){
  return request({
    url:'/member/user/create-audit-enterprise',
    method:'put',
    data:data,
  })
}
//新增用户
export function createAuditIdCard(data){
  return request({
    url:'/member/user/create-audit-idcard',
    method:'put',
    data
  })
}
