import request from '@/utils/request'

// 新增平台分类
export function merchantCategoryAdd (data) {
  return request({
    url: '/system/merchantCategory/add',
    method: 'post',
    data
  })
}
// 删除平台分类
export function merchantCategoryDel (categoryId) {
  return request({
    url: `/system/merchantCategory/del/${categoryId}`,
    method: 'post',
  })
}
// 修改平台分类
export function merchantCategoryEdit (data) {
  return request({
    url: `/system/merchantCategory/edit`,
    method: 'post',
    data
  })
}
// 获取平台分类详细信息
export function merchantCategoryInfo (categoryId) {
  return request({
    url: `/system/merchantCategory/info/${categoryId}`,
    method: 'get',
  })
}
// 查询平台分类列表
export function merchantCategoryPage (query) {
  return request({
    url: `/system/merchantCategory/page`,
    method: 'get',
    params: query
  })
}
// 修改平台分类上架状态
export function merchantCategoryShelved (categoryId) {
  return request({
    url: `/system/merchantCategory/shelved/${categoryId}`,
    method: 'post',
  })
}
// 加载顶级分类
export function merchantCategoryTops (query) {
  return request({
    url: `/system/merchantCategory/tops`,
    method: 'get',
    params: query
  })
}
// 加载顶级分类树
export function merchantCategoryTree (query) {
  return request({
    url: `/system/merchantCategory/tree`,
    method: 'get',
    params: query
  })
}