import { request } from '../config'

export function listCategory(params: any) {
  return request({
    url: '/category/list',
    method: 'get',
    params
  })
}

export function listCatL1() {
  return request({
    url: '/category/l1',
    method: 'get'
  })
}

export function createCategory(data: any) {
  return request({
    url: '/category/create',
    method: 'post',
    data
  })
}

export function readCategory(data: any) {
  return request({
    url: '/category/read',
    method: 'get',
    data
  })
}

export function updateCategory(data: any) {
  return request({
    url: '/category/update',
    method: 'post',
    data
  })
}

export function deleteCategory(data: any) {
  return request({
    url: '/category/delete',
    method: 'post',
    data
  })
}
