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


const apisrc = {
  CargoOwnerLicenseList: upcloud_base_chain + '/baseCustomerMst/v1.0/findAll',
  pageList: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/pageList',
  addItem: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/saveCargoOwnerMst',
  update: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/updateCargoOwnerMst',
  infoById: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/infoById',
  deleteCargoById: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/deleteCargoById'
}

const API = {
  CargoOwnerLicenseList: {
    method: 'post',
    url: apisrc.CargoOwnerLicenseList
  },
  pageList: { url: apisrc.pageList, method: 'post' },
  addItem(parameter) {
    return request({
      method: 'post',
      url: apisrc.addItem,
      data: parameter
    })
  },

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

export default API
