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


const apisrc = {
  findAll: upcloud_base_chain + '/baseCustomerMst/v1.0/page',
  addItem: upcloud_base_chain + '/baseCustomerMst/v1.0/addWithAttr',
  // pageList: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/pageList',
  // addItem: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/saveCargoOwnerMst',
  deleteCargoById: upcloud_base_chain + '/baseCustomerMst/v1.0/delete',
  update: upcloud_base_chain + '/baseCustomerMst/v1.0/editWithAttr',
  infoById: upcloud_base_chain + '/baseCustomerMst/v1.0/findWithAttr',
  findScope: upcloud_base_chain + '/companyScope/findAll',
}

const API = {
  findAll: { url: apisrc.findAll, method: 'post' },
  addItem(parameter) {
    return request({
      method: 'post',
      url: apisrc.addItem,
      data: parameter
    })
  },
  deleteCargoById(parameter) {
    return request({
      method: 'post',
      url: apisrc.deleteCargoById,
      data: parameter
    })
  },
  update(parameter) {
    return request({
      method: 'post',
      url: apisrc.update,
      data: parameter
    })
  },
  infoById(parameter) {
    return request({
      method: 'get',
      url: apisrc.infoById,
      params: parameter
    })
  },
  
  findScope(parameter) {
    return request({
      method: 'get',
      url: apisrc.findScope,
      params: parameter
    })
  }
}

export default API
