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

export default {
  paging(data: CraftTypes.SearchCraftParam) {
    return get<G.PageResult<CraftTypes.SearchCraftResult>>('/craft/paging', data)
  },
  detail(id: string) {
    return get<CraftTypes.SearchCraftResult>('/craft/detail', {id})
  },
  add(data: CraftTypes.AddCraftParam) {
    return post('/craft/add', data)
  },
  modify(data: CraftTypes.ModifyCraftParam) {
    return post('/craft/modify', data)
  },
  del(ids: string[]) {
    return post('/craft/del', ids)
  },
  disable(id: string, disable: boolean) {
    return get('/craft/disable', {id, disable})
  },
}
