import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LevelsVO, LevelsForm, LevelsQuery } from '@/api/system/business/levels/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listLevels = (query?: LevelsQuery): AxiosPromise<LevelsVO[]> => {
  return request({
    url: '/business/levels/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param id
 */
export const getLevels = (id: string | number): AxiosPromise<LevelsVO> => {
  return request({
    url: '/business/levels/' + id,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addLevels = (data: LevelsForm) => {
  return request({
    url: '/business/levels',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateLevels = (data: LevelsForm) => {
  return request({
    url: '/business/levels',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param id
 */
export const delLevels = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/levels/' + id,
    method: 'delete'
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param id
 */
export const selectBlindLevelsById = (id: number): AxiosPromise<LevelsVO[]> => {
  return request({
    url: '/business/levels/selectBlindLevelsById/' + id,
    method: 'get'
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param id
 */
export const selectBlindLevelsByTournament = (id: number): AxiosPromise<LevelsVO[]> => {
  return request({
    url: '/business/levels/selectBlindLevelsByTournament/' + id,
    method: 'get'
  });
};
