import { request } from '@/service/request';

/**
 *
 * @returns 获取所有标签列表
 */
export function fetchGetAllTagList() {
  return request<Api.goods.tag[]>({
    url: '/platform/label/listAll',
    method: 'get'
  });
}

/**
 * 分页获取标签列表
 * @param params
 * @returns
 */
export function fetchGetTagList(params: any) {
  return request<Api.goods.tag[]>({
    url: '/platform/label/page',
    method: 'get',
    params
  });
}

/**
 * 添加标签
 * @param data
 * @returns
 */
export function fetchAddTag(data: any) {
  return request({
    url: '/platform/label',
    method: 'post',
    data
  });
}

/**
 * 编辑标签
 */
export function fetchEditTag(data: any) {
  return request({
    url: '/platform/label',
    method: 'put',
    data
  });
}

/**
 * 删除标签
 * @param data
 * @returns
 */
export function fetchDeleteTag(data: any) {
  return request({
    url: '/platform/label',
    method: 'delete',
    data
  });
}
