import request from '@/utils/request'

// 新增商家商品分类
export function productCategoryAdd(data) {
    return request({
        url: '/shop/productCategory/add',
        method: 'post',
        data
    })
}
// 删除商家商品分类
export function productCategoryDel(categoryId) {
    return request({
        url: `/shop/productCategory/del/${categoryId}`,
        method: 'post',
    })
}
// 修改商家商品分类
export function productCategoryEdit(data) {
    return request({
        url: `/shop/productCategory/edit`,
        method: 'post',
        data
    })
}
// 获取商家商品分类详细信息
export function productCategoryInfo(categoryId) {
    return request({
        url: `/shop/productCategory/info/${categoryId}`,
        method: 'get',
    })
}
// 分页查询商家商品分类列表
export function productCategoryPage(query) {
    return request({
        url: `/shop/productCategory/page`,
        method: 'get',
        params: query
    })
}
// 查询商家商品分类列表
export function productCategoryList(query) {
    return request({
        url: `/shop/productCategory/list`,
        method: 'get',
        params: query
    })
}
// 修改商家商品分类上架状态
export function productCategoryShelved(categoryId) {
    return request({
        url: `/shop/productCategory/shelvedStatus/${categoryId}`,
        method: 'post',
    })
}
// 加载顶级分类
export function productCategoryTops(query) {
    return request({
        url: `/shop/productCategory/tops`,
        method: 'get',
        params: query
    })
}
// 加载顶级分类树
export function productCategoryTree(query) {
    return request({
        url: `/shop/productCategory/tree`,
        method: 'get',
        params: query
    })
}