import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { GameEventMenuVO, GameEventMenuForm, GameEventMenuQuery } from '@/api/system/gameEventMenu/types';

/**
 * 查询基础菜单列表
 * @param query
 * @returns {*}
 */

export const listGameEventMenu = (query?: GameEventMenuQuery): AxiosPromise<GameEventMenuVO[]> => {
  return request({
    url: '/system/gameEventMenu/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询基础菜单详细
 * @param menuId
 */
export const getGameEventMenu = (menuId: string | number): AxiosPromise<GameEventMenuVO> => {
  return request({
    url: '/system/gameEventMenu/' + menuId,
    method: 'get'
  });
};

/**
 * 新增基础菜单
 * @param data
 */
export const addGameEventMenu = (data: GameEventMenuForm) => {
  return request({
    url: '/system/gameEventMenu',
    method: 'post',
    data: data
  });
};

/**
 * 修改基础菜单
 * @param data
 */
export const updateGameEventMenu = (data: GameEventMenuForm) => {
  return request({
    url: '/system/gameEventMenu',
    method: 'put',
    data: data
  });
};

/**
 * 删除基础菜单
 * @param menuId
 */
export const delGameEventMenu = (menuId: string | number | Array<string | number>) => {
  return request({
    url: '/system/gameEventMenu/' + menuId,
    method: 'delete'
  });
};
