import request from '@/utils/request'

const baseUrl = import.meta.env.VITE_APP_BASE_API

// 载具类别列表
export function listCategory(query) {
  return request({
    url: baseUrl + '/business/carrier/categoryList',
    method: 'get',
    params: query
  })
}

// 查询载具类别
export function getCategory(id) {
  return request({
    url: baseUrl + '/business/carrier/getCategoryInfo/' + id,
    method: 'get'
  })
}

// 保存载具类别
export function saveCategory(data) {
  return request({
    url: baseUrl + '/business/carrier/saveCategory',
    method: 'post',
    data: data
  })
}

// 删除载具类别
export function delCategory(id) {
  return request({
    url: baseUrl + '/business/carrier/removeCategory/' + id,
    method: 'delete'
  })
}

/* ************************** 载具相关接口 *************************** */

// 查询载具管理列表
export function listCarrier(query) {
  return request({
    url: baseUrl + '/business/carrier/list',
    method: 'get',
    params: query
  })
}

// 查询载具管理详细
export function getCarrier(id) {
  return request({
    url: baseUrl + '/business/carrier/getInfo/' + id,
    method: 'get'
  })
}

// 新增载具管理
export function saveCarrier(data) {
  return request({
    url: baseUrl + '/business/carrier/save',
    method: 'post',
    data: data
  })
}

// 删除载具管理
export function delCarrier(id) {
  return request({
    url: baseUrl + '/business/carrier/remove/' + id,
    method: 'delete'
  })
}
