import request from '@/config/axios'

// 门店桌号分类 VO
export interface ShopDeskCategoryVO {
  id: number // 分类编号
  shopId: number // 店铺id用'
  parentId: number // 父分类编号
  shopName: string // 店铺名称
  name: string // 分类名称
  picUrl: string // 分类图片
  people: number // 人数
  sort: number // 分类排序
  description: string // 分类描述
  status: number // 开启状态
}

// 门店桌号分类 API
export const ShopDeskCategoryApi = {
  // 查询门店桌号分类分页
  getShopDeskCategoryPage: async (params: any) => {
    return await request.get({ url: `/desk/shop-desk-category/page`, params })
  },

  // 查询门店桌号分类详情
  getShopDeskCategory: async (id: number) => {
    return await request.get({ url: `/desk/shop-desk-category/get?id=` + id })
  },

  // 新增门店桌号分类
  createShopDeskCategory: async (data: ShopDeskCategoryVO) => {
    return await request.post({ url: `/desk/shop-desk-category/create`, data })
  },

  // 修改门店桌号分类
  updateShopDeskCategory: async (data: ShopDeskCategoryVO) => {
    return await request.put({ url: `/desk/shop-desk-category/update`, data })
  },

  // 删除门店桌号分类
  deleteShopDeskCategory: async (id: number) => {
    return await request.delete({ url: `/desk/shop-desk-category/delete?id=` + id })
  },

  // 导出门店桌号分类 Excel
  exportShopDeskCategory: async (params) => {
    return await request.download({ url: `/desk/shop-desk-category/export-excel`, params })
  }
}