import { axios } from '@/utils/request'

// 商品分类列表
export const goodsTypeList = (params) => {
  const url = `/goodsType/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}
// 商品分类列表 - 不分页
export const goodsTypeQueryList = (params) => {
  return axios.request({
    url: '/goodsType/queryList',
    data: params,
    method: 'post'
  })
}
// 保存商品分类
export const goodsTypeSave = (params) => {
  return axios.request({
    url: '/goodsType/save',
    data: params,
    method: 'post'
  })
}
// 商品分类详情
export const goodsTypeFind = (params) => {
  return axios.request({
    url: `/goodsType/findById/${params.id}`,
    method: 'get'
  })
}
// 商品分类启禁用
export const goodsTypeEnable = (params) => {
  return axios.request({
    url: `/goodsType/enable/${params.id}/${params.flag}`,
    method: 'get'
  })
}
