import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/platform/userApp/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/platform/userApp/detail',
    method: 'get',
    params: {
      userId: id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/platform/userApp/remove',
    method: 'post',
    params: {
      ids,
    },
    responseType: "blob"
  })
}

export const add = (row) => {
  return request({
    url: '/api/platform/userApp/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/platform/userApp/submit',
    method: 'post',
    data: row
  })
}
export const untie = (id) => {
  return request({
    url: '/api/v1/rollBackGrant',
    method: 'post',
    params: {
      userId: id
    }
  })
}

export const sendValidCode = () => {
  return request({
    url: '/api/platform/userticket/send-validate',
    method: 'get'
  })
}

export const addUserScore = (param) => {
  return request({
    url: '/api/platform/userticket/addUserScore',
    method: 'post',
    data: param
  })
}

export const addStore = (param) => {
  return request({
    url: '/api/mall/store/submit',
    method: 'post',
    data: param
  })
}

export const addRedIntegral = (param) => {
  return request({
    url: '/api/redenvelopemall/redintegral/addUserScore',
    method: 'post',
    data: param
  })
}

export const expExcelConsign = (param) => {
  return request({
    url: '/api/shopping/consign/expExcelConsign',
    method: 'post',
    data: param,
    responseType: 'blob'
  })
}

export const removeCommander = (row) => {
  return request({
    url: '/api/platform/userApp/remove-commander',
    method: 'post',
    data: row
  })
}

export const setUpCommander = (row) => {
  return request({
    url: '/api/platform/userApp/set-up-commander',
    method: 'post',
    data: row
  })
}
