import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { XfLimitedVO, XfLimitedForm, XfLimitedQuery } from '@/api/consumption/xfLimited/types';

/**
 * 查询限次管理列表
 * @param query
 * @returns {*}
 */
export const listXfLimited = (query?: XfLimitedQuery): AxiosPromise<XfLimitedVO[]> => {
  return request({
    url: '/backstage/consumption/xfLimited/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询限次管理详细
 * @param limitedId
 */
export const getXfLimited = (limitedId: string | number): AxiosPromise<XfLimitedVO> => {
  return request({
    url: '/backstage/consumption/xfLimited/' + limitedId,
    method: 'get'
  });
};

/**
 * 新增限次管理
 * @param data
 */
export const addXfLimited = (data: XfLimitedForm) => {
  return request({
    url: '/backstage/consumption/xfLimited',
    method: 'post',
    data: data
  });
};

/**
 * 修改限次管理
 * @param data
 */
export const updateXfLimited = (data: XfLimitedForm) => {
  return request({
    url: '/backstage/consumption/xfLimited',
    method: 'put',
    data: data
  });
};

/**
 * 删除限次管理
 * @param limitedId
 */
export const delXfLimited = (limitedId: string | number | Array<string | number>) => {
  return request({
    url: '/backstage/consumption/xfLimited/' + limitedId,
    method: 'delete'
  });
};
