import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TournamentMenuVO, TournamentMenuForm, TournamentMenuQuery } from '@/api/system/physical/tournamentMenu/types';

/**
 * 查询锦标赛功能菜单配置列表
 * @param query
 * @returns {*}
 */

export const listTournamentMenu = (query?: TournamentMenuQuery): AxiosPromise<TournamentMenuVO[]> => {
  return request({
    url: '/physical/tournamentMenu/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询锦标赛功能菜单配置详细
 * @param id
 */
export const getTournamentMenu = (id: string | number): AxiosPromise<TournamentMenuVO> => {
  return request({
    url: '/physical/tournamentMenu/' + id,
    method: 'get'
  });
};

/**
 * 新增锦标赛功能菜单配置
 * @param data
 */
export const addTournamentMenu = (data: TournamentMenuForm) => {
  return request({
    url: '/physical/tournamentMenu',
    method: 'post',
    data: data
  });
};
/**
 * 修改锦标赛功能菜单配置
 * @param data
 */
export const updateTournamentMenu = (data: TournamentMenuForm) => {
  return request({
    url: '/physical/tournamentMenu',
    method: 'put',
    data: data
  });
};
export const auditTournamentMenu = (data: TournamentMenuForm) => {
  return request({
    url: '/physical/tournamentMenu/auditTournamentMenu',
    method: 'put',
    data: data
  });
};
/**
 * 删除锦标赛功能菜单配置
 * @param id
 */
export const delTournamentMenu = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/tournamentMenu/' + id,
    method: 'delete'
  });
};
