import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LeagueTournamentVO, LeagueTournamentForm, LeagueTournamentQuery } from '@/api/system/physical/leagueTournament/types';
import { StoreVO } from '@/api/system/physical/store/types';

/**
 * 查询锦标赛联赛列表
 * @param query
 * @returns {*}
 */

export const listLeagueTournament = (query?: LeagueTournamentQuery): AxiosPromise<LeagueTournamentVO[]> => {
  return request({
    url: '/physical/leagueTournament/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询锦标赛联赛详细
 * @param id
 */
export const getLeagueTournament = (id: string | number): AxiosPromise<LeagueTournamentVO> => {
  return request({
    url: '/physical/leagueTournament/' + id,
    method: 'get'
  });
};

/**
 * 新增锦标赛联赛
 * @param data
 */
export const addLeagueTournament = (data: LeagueTournamentForm) => {
  return request({
    url: '/physical/leagueTournament',
    method: 'post',
    data: data
  });
};

/**
 * 修改锦标赛联赛
 * @param data
 */
export const updateLeagueTournament = (data: LeagueTournamentForm) => {
  return request({
    url: '/physical/leagueTournament',
    method: 'put',
    data: data
  });
};
export const updateOpenOrCloseByBo = (data: LeagueTournamentForm) => {
  return request({
    url: '/physical/leagueTournament/updateOpenOrCloseByBo',
    method: 'put',
    data: data
  });
};
/**
 * 删除锦标赛联赛
 * @param id
 */
export const delLeagueTournament = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/leagueTournament/' + id,
    method: 'delete'
  });
};
export const selectPhysicalLeagueTournamentSelList = (): AxiosPromise<LeagueTournamentVO> => {
  return request({
    url: '/physical/leagueTournament/selectPhysicalLeagueTournamentSelList',
    method: 'get'
  });
};
