import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const generateApi = (ids) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/generateApi',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/submit',
    method: 'post',
    data: row
  })
}


export const getByAccount = () => {
  return request({
    url: '/api/cyzh-guosen/bussiness/getByAccount',
    method: 'get',

  })
}

export const enableBussiness = (params) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/enableBussiness',
    method: 'get',
    params: {
      ...params
    }
  })
}

export const queryBusinessBalance = (bussinessId) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/queryBusinessBalance',
    method: 'get',
    params: {
      bussinessId
    }
  })
}

export const queryPlatformBalance = () => {
  return request({
    url: '/api/cyzh-guosen/bussiness/queryPlatformBalance',
    method: 'get',
  })
}

export const listBussiness = (params) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/listBussiness',
    method: 'get',
    params: {
      ...params
    }
  })
}

export const testSubmit = (row) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/testSubmit',
    method: 'post',
    data: row
  })
}

export const getByBussinessType = (bussinessType) => {
  return request({
    url: '/api/cyzh-guosen/bussiness/getByBussinessType',
    method: 'get',
    params: {
      bussinessType
    }
  })
}
