import { request } from 'umi';
import { api } from '../api';
import { Paging, SortProps } from './rankingList';
import { ActiveEnum } from '@/components/QueryForm/const';
let wapi = api + '/gameData'

export interface GameServerListProps extends Paging, SortProps {
    beginDate?: string,
    endDate?: string,
    gameId?: number,
    serverId?: number,
    serverName?: string,
    activeTypes?: ActiveEnum
}
/**
 * 游戏区服列表
 * @param data 
 * @returns 
 */
export async function getGameServerListApi(data: GameServerListProps) {
    return request(wapi + `/gameServer/day`, {
        method: 'POST',
        data
    });
}

/**
 * 游戏区服总计
 * @param data 
 * @returns 
 */
export async function getGameServerTotalApi(data: GameServerListProps) {
    return request(wapi + `/gameServer/day/total`, {
        method: 'POST',
        data
    });
}



export interface GameServerEveryListProps extends Paging, SortProps {
    beginDate?: string,
    endDate?: string,
    gameId?: number,
}
/**
 * 游戏区服每日列表
 * @param data 
 * @returns 
 */
export async function getGameServerEveryListApi(data: GameServerEveryListProps) {
    return request(wapi + `/gameServer/sum/day`, {
        method: 'POST',
        data
    });
}

/**
 * 游戏区服每日总计
 * @param data 
 * @returns 
 */
export async function getGameServerEveryTotalApi(data: GameServerEveryListProps) {
    return request(wapi + `/gameServer/sum/day/total`, {
        method: 'POST',
        data
    });
}

export interface GameServerGsListProps extends Paging, SortProps {
    gameId?: number,
    gsId?: number,
    serverName?: string,
    serverId?: number,
    beginDate?: string,
    endDate?: string
}
/**
 * GS区服
 * @param data 
 * @returns 
 */
export async function getGameServerGsListApi(data: GameServerGsListProps) {
    return request(wapi + `/gameServer/gs/day`, {
        method: 'POST',
        data
    });
}

/**
 * GS区服总计
 * @param data 
 * @returns 
 */
export async function getGameServerGsTotalApi(data: GameServerGsListProps) {
    return request(wapi + `/gameServer/gs/total`, {
        method: 'POST',
        data
    });
}