import {
  get,
  post,
} from '@/common/utils/http-util.ts'

export default {
  paging(data: GoodsTypes.SearchGoodsParam) {
    return get<G.PageResult<GoodsTypes.SearchGoodsResult>>('/goods/paging', data)
  },
  detail(id: string) {
    return get<GoodsTypes.SearchGoodsResult>('/goods/detail', {id})
  },
  add(data: GoodsTypes.AddGoodsParam) {
    return post('/goods/add', data)
  },
  modify(data: GoodsTypes.ModifyGoodsParam) {
    return post('/goods/modify', data)
  },
  del(ids: string[]) {
    return post('/goods/del', ids)
  },
  enable(param: { enable: boolean; id: string }) {
    return get('/goods/enable', param)
  },
}
