import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GameEventConfigTypeVO, GameEventConfigTypeForm, GameEventConfigTypeQuery } from '@/api/system/gameEventConfigType/types';

/**
 * 查询赛事配置类型列表
 * @param query
 * @returns {*}
 */

export const listGameEventConfigType = (query?: GameEventConfigTypeQuery): AxiosPromise<GameEventConfigTypeVO[]> => {
  return request({
    url: '/system/gameEventConfigType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询赛事配置类型详细
 * @param typeId
 */
export const getGameEventConfigType = (typeId: string | number): AxiosPromise<GameEventConfigTypeVO> => {
  return request({
    url: '/system/gameEventConfigType/' + typeId,
    method: 'get'
  });
};

/**
 * 新增赛事配置类型
 * @param data
 */
export const addGameEventConfigType = (data: GameEventConfigTypeForm) => {
  return request({
    url: '/system/gameEventConfigType',
    method: 'post',
    data: data
  });
};

/**
 * 修改赛事配置类型
 * @param data
 */
export const updateGameEventConfigType = (data: GameEventConfigTypeForm) => {
  return request({
    url: '/system/gameEventConfigType',
    method: 'put',
    data: data
  });
};

/**
 * 删除赛事配置类型
 * @param typeId
 */
export const delGameEventConfigType = (typeId: string | number | Array<string | number>) => {
  return request({
    url: '/system/gameEventConfigType/' + typeId,
    method: 'delete'
  });
};
