import type { AxiosResponse } from 'axios'
import request from 'Plugins/axios'

// 商品列表
export const apiProductList = async (data: ListDto): AxiosResponseDataType<ListResponseData<ProductItem[]>> =>
  request.get('/jeecgboot/vendor/merchandise/supplierMerchandise/list', data)

// 上架下架
export const apiToggleStatus = async (data: ILogin): AxiosResponseDataType<null> =>
  request.get('/jeecgboot/vendor/merchandise/supplierMerchandise/onOrOff', data)

// 商品详情
export const apiProductDetail = async (data: ILogin): AxiosResponseDataType<LoginInfoRespData> =>
  request.get('/jeecgboot/vendor/merchandise/supplierMerchandise/queryById', data)

// 检查 品牌下的商品是否超数量限制
export const apiProductLimit = async (data: ILogin): AxiosResponseDataType<LoginInfoRespData> =>
  request.get('/jeecgboot/vendor/merchandise/supplierMerchandise/queryMaxBysSupplierId', data)

// 商品新增
export const apiProductAdd = async (data: ILogin): AxiosResponseDataType<LoginInfoRespData> =>
  request.post('/jeecgboot/vendor/merchandise/supplierMerchandise/addToSupplier', data)

// 商品修改
export const apiProductEdit = async (data: ILogin): AxiosResponseDataType<LoginInfoRespData> =>
  request.post('/jeecgboot/vendor/merchandise/supplierMerchandise/edit', data)

// 商品删除
export const apiProductDelete = async (data: ILogin): AxiosResponseDataType<LoginInfoRespData> =>
  request.delete('/jeecgboot/vendor/merchandise/supplierMerchandise/delete', data)

