import request from '@/utils/request'
import { upcloud_base_wh_control,upcloud_base_wh,upcloud_base_chain } from "@/config/serviceSettings";

const apisrc = {
  warehouse: upcloud_base_wh + '/warehouse/page',
  CargoOwnerLicenseList: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/pageList',
  datarelationWhCustomer: upcloud_base_wh_control + '/datarelationWhCustomer/page',
  batchAdd: upcloud_base_wh_control + '/datarelationWhCustomer/batchAdd',
  delete: upcloud_base_wh_control + '/datarelationWhCustomer/delete',
  info: upcloud_base_wh_control + '/datarelationWhCustomer/info',
  unpage: upcloud_base_wh_control + '/datarelationWhCustomer/unpage'
}

const API = {
  warehouse: {
    method: 'get',
    url: apisrc.warehouse
  },
  CargoOwnerLicenseList: {
    method: 'post',
    url: apisrc.CargoOwnerLicenseList
  },
  //条件查询
  datarelationWhCustomer: {
    url: apisrc.datarelationWhCustomer,
    method: 'post'
  },
  //新增关联关系
  batchAdd(parameter) {
    return request({
      method: 'post',
      url: apisrc.batchAdd,
      data: parameter
    })
  },
  //批量删除
  delete(parameter) {
    return request({
      method: 'post',
      url: apisrc.delete,
      params: parameter
    })
  },
  infos(parameter) {
    return request({
      method: 'post',
      url: apisrc.info,
      params: parameter
    })
  },
  //  查询单条信息 POST
  info: {
    method: 'post',
    url: apisrc.info
  },
  // 未关联客户查询 POST
  unpage: {
    method: 'post',
    url: apisrc.unpage
  }

  // infoById(parameter) {
  //   return request({
  //     method: 'get',
  //     url: apisrc.infoById,
  //     params: parameter
  //   })
  // }
}

export default API
