import { post, get ,instance} from "@/utils/request";

enum URL {
  // 游戏列表
  gameList = '/getGameInfoList',
  //获取游戏分类列表
  getGameClassList = '/getGameClassList',
  // 单个游戏url 
  getGameUrl = '/getGameUrl',
  // message 
  getMsgServer = '/getMsgServer',
  // 游戏平台列表
  getGameProviderList = '/getGameProviderList',

  getGameTypeList = '/getGameTypeList',
  
  getAds = '/getAdsList',
  getTaskList='/getTaskList',
  getCustomClassList='getCustomClassList',
  getTaskAward='receiveTaskAward',

  collectGame='favorGame',
  uncollectGame='cancelFavorGame',
  getHelpTurntableResult='getTurntable2Result'
}


export const gameList = (data: any) => post(URL.gameList, data);

export const getGameClassList = (data: any) => post(URL.getGameClassList, data);

export const getGameUrl = (data: any) => post(URL.getGameUrl, data);

export const getMsgServer = () => post(URL.getMsgServer);

export const getGameProviderList = (data: any) => post(URL.getGameProviderList, data);
export const getHelpTurntableResult = (data: any) => post(URL.getHelpTurntableResult, data);

export const getGameTypeList = (data: any) => post(URL.getGameTypeList, data);

export const getAds = () => post(URL.getAds);
export const getTaskList = async (data: any) => {
  return await instance(URL.getTaskList, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getTaskAward = async (data: any) => {
  return await instance(URL.getTaskAward, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};
export const getCustomClassList = () => post(URL.getCustomClassList);
export const uncollectGame = (data: any) => post(URL.uncollectGame, data);
export const collectGame = (data: any) => post(URL.collectGame, data);
