import { request } from 'umi';
import { api } from '../api';
import { Paging, SortProps } from '../gameData/rankingList';
let wapi = api + '/gameGsData'


export interface GetBigRProps extends Paging, SortProps {
    roleSource: 1 | 2, // 必填：角色来源：1：区服指派；2：角色指派
    sourceSystem: string, // 必填：SDK来源；默认ZX_ONE
    dtBegin?: string, // 充值统计日期开始
    dtEnd?: string,
    gsIdList?: number[],    // 消耗开始时间
    humanRemoveGameStatus?: 0 | 1, // 人工判断角色退游状态：0：未退游；1：退游
    parentGameId?: number,   // 父游戏id
    roleCreateDayBegin?: string  // 角色创建日期开始
    roleCreateDayEnd?: string
    roleName?: string   // 角色名称
    serveDayBegin?: string, // 服务日期开始
    serveDayEnd?: string,
    serveStatus?: 1 | 2, // 服务状态：1：服务中；2：服务完成
    serverIdList?: string[], // 角色当前所在区服id列表
    superGameId?: number,  //超父游戏id 
    systemRemoveGameStatus?: 0 | 1 // 系统判断角色退游状态：0：未退游；1：退游
}
/**
 * 大R每日充值比
 * @param data 
 * @returns 
 */
export async function getBigRApi(data: GetBigRProps) {
    return request(wapi + `/game/parent/bigR/listOfPage`, {
        method: 'POST',
        data
    });
}

export interface GetRolePayRetainedProps extends Paging, SortProps {
    dtBegin?: string,
    dtEnd?: string,
    gsIdList?: number[],

}
/**
 * 
GS角色付费留存
 * @param data 
 * @returns 
 */
export async function getRolePayRetainedApi(data: GetRolePayRetainedProps) {
    return request(wapi + `/game/parent/role/pay/retained/listOfPage`, {
        method: 'POST',
        data
    });
}

/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getRolePayRetainedTotalApi(data: GetRolePayRetainedProps) {
    return request(wapi + `/game/parent/role/pay/retained/total`, {
        method: 'POST',
        data
    });
}




export interface GetRoleRemoveProps extends Paging, SortProps {
    roleSource: 1 | 2, // 必填：角色来源：1：区服指派；2：角色指派
    sourceSystem: string, // 必填：SDK来源；默认ZX_ONE
    gsIdList?: number[],    // gs id 列表
    parentGameId?: number,   // 父游戏id
    roleCreateDayBegin?: string  // 角色创建日期开始
    roleCreateDayEnd?: string
    roleName?: string   // 角色名称
    serveDayBegin?: string, // 服务日期开始
    serveDayEnd?: string,
    serverIdList?: string[], // 角色当前所在区服id列表
    superGameId?: number,  //超父游戏id
}
/**
 * 大R每日充值比
 * @param data 
 * @returns 
 */
export async function getRoleRemoveListApi(data: GetRoleRemoveProps) {
    return request(wapi + `/game/parent/role/remove/game/monitor`, {
        method: 'POST',
        data
    });
}


export interface GetServerPayRetainedProps extends Paging, SortProps {
    serveDayBegin?: string,  // 服务开始日期
    serveDayEnd?: string,    // 服务结束日期
    gsIdList?: number[],
    gsStatus?: 1 | 2,        // GS运营状态：1：独立运营；2：联合运营
    parentGameId?: number,
    superGameId?: number,
    serveStatus?: 1 | 2,     // 服务状态：1：服务中；2：服务完成
    serverIdList?: number[]  // 角色当前所在区服id列表
    serverStartBegin?: string, // 开服日期
    serverStartEnd?: string,
}

/**
 * GS角色付费留存
 * @param data 
 * @returns 
 */
export async function getServerPayRetainedApi(data: GetServerPayRetainedProps) {
    return request(wapi + `/game/parent/server/pay/retained/listOfPage`, {
        method: 'POST',
        data
    });
}

/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getServerPayRetainedTotalApi(data: GetServerPayRetainedProps) {
    return request(wapi + `/game/parent/server/pay/retained/total`, {
        method: 'POST',
        data
    });
}

export interface getRoleManageProps extends Paging, SortProps {
    gsIdList?: number[],
    parentGameId?: number,
    superGameId?: number,
    roleCreateDayBegin?: string, // 角色创建日期开始
    roleCreateDayEnd?: string,
    roleName?: string,
    serveDayBegin?: string,  // 服务开始日期
    serveDayEnd?: string,    // 服务结束日期
    serveStatus?: 1 | 2,     // 服务状态：1：服务中；2：服务完成
    serverIdList?: number[]  // 角色当前所在区服id列表
    gsStatus?: 1 | 2,        // GS运营状态：1：独立运营；2：联合运营
}
/**
 * 游戏角色管理
 * @param data 
 * @returns 
 */
export async function getRoleManageListApi(data: getRoleManageProps) {
    return request(wapi + `/game/parent/role/manage`, {
        method: 'POST',
        data
    });
}


export interface GetServerManageProps extends Paging, SortProps {
    gsIdList?: number[],
    gsStatus?: 1 | 2,        // GS运营状态：1：独立运营；2：联合运营
    parentGameId?: number,
    superGameId?: number,
    serveDayBegin?: string,  // 服务开始日期
    serveDayEnd?: string,    // 服务结束日期
    serveStatus?: 1 | 2,     // 服务状态：1：服务中；2：服务完成
    serverIdList?: number[]  // 角色当前所在区服id列表
    serverStartBegin?: string, // 开服日期
    serverStartEnd?: string,
}
/**
 * 游戏区服管理
 * @param data 
 * @returns 
 */
export async function getServerManageListApi(data: GetServerManageProps) {
    return request(wapi + `/game/parent/serve/manage`, {
        method: 'POST',
        data
    });
}


export interface GetRoleLevelListProps extends Paging, SortProps {
    roleName?: string
    roleId?: string
    gameName?: string
    gameId?: string
    serverName?: string
    serverId?: string
    createTimeMin?: string
    createTimeMax?: string
    roleLevelMin?: number
    roleLevelMax?: number
    levelTimeMin?: number
    levelTimeMax?: number
}
/**
 * 角色等级列表 仙剑
 * @param data 
 * @returns 
 */
export async function getRoleLevelListApi(data: GetRoleLevelListProps) {
    return request(api + `/gameData/role/level/listOfPage`, {
        method: 'POST',
        data
    });
}

export interface GetRoleIpInfoListProps extends Paging, SortProps {
    userId?: number
    userName?: string
    roleId?: number
    roleName?: string
    gameId?: number
    gameName?: string
    serverId?: number
    serverName?: string
    createTimeMin?: string
    createTimeMax?: string
    roleLevelMin?: number
    roleLevelMax?: number
    regIp?: string
}
/**
 * 角色IP监控信息列表
 * @param data 
 * @returns 
 */
export async function getRoleIpInfoListApi(data: GetRoleIpInfoListProps) {
    return request(api + `/gameData/role/ipInfo/listOfPage`, {
        method: 'POST',
        data
    });
}

/**
 * 游戏帮派详情
 * @param data 
 * @returns 
 */
export async function getGameCountryListApi(data: { gameId?: number, serverId?: number }) {
    return request(api + `/gameData/role/gameCountryList`, {
        method: 'POST',
        data
    });
}

export interface GetGameCountryDataListProps {
    gameCountryList?: string[],
    gameId?: number[]
    serverId?: number[]
}
/**
 * 游戏帮派数据列表
 * @param data 
 * @returns 
 */
export async function getGameCountryDataListApi(data: GetGameCountryDataListProps) {
    return request(api + `/gameData/role/gameCountryDataList`, {
        method: 'POST',
        data
    });
}


export interface getGameCountryRoleListProps extends Paging, SortProps {
    country: string
    serverId: string
    countryLevel: number
}
/**
 * 游戏帮派角色列表（分页）
 * @param data 
 * @returns 
 */
export async function getGameCountryRoleListApi(data: getGameCountryRoleListProps) {
    return request(api + `/gameData/role/gameCountryRoleList`, {
        method: 'POST',
        data
    });
}


/**
 * 角色ip登录详情列表
 * @param data 
 * @returns 
 */
export async function getRoleIpDetail1ListApi(data: { roleId: string }) {
    return request(api + `/gameData/role/roleIpDetail/list`, {
        method: 'POST',
        data
    });
}


/**
 * 同IP角色数量
 * @param data 
 * @returns 
 */
export async function getRoleDetailListApi(data: { roleId: string, excludeUserType: 0 | 1 }) {
    return request(api + `/gameData/role/roleDetailList`, {
        method: 'POST',
        data
    });
}

/**
 * 角色同IP的玩家
 * @param data 
 * @returns 
 */
export async function getUserDetailListApi(data: { roleId: string }) {
    return request(api + `/gameData/role/userDetail/list`, {
        method: 'POST',
        data
    });
}

/**
 * 查询疑似同玩家角色详情列表
 * @param data 
 * @returns 
 */
export async function getSuspectedRoleDetailListApi(data: { roleId: string }) {
    return request(api + `/gameData/role/suspectedRoleDetailList`, {
        method: 'POST',
        data
    });
}

export interface GetRoleChatListProps extends Paging, SortProps {
    roleId?: string
    roleName?: string
    superGameId?: number
    serverId?: number
    country?: string
    startDate?: string
    endDate?: string
}
/**
 * 角色日维度的聊天数量统计列表
 * @param data 
 * @returns 
 */
export async function getRoleChatListApi(data: GetRoleChatListProps) {
    return request(api + `/gameData/role/chatListOfPage`, {
        method: 'POST',
        data
    });
}

export interface GetRoleChatDetailsListApiProps extends Paging, SortProps {
    roleId?: string
    startDate?: string
    endDate?: string
}
/**
 * 聊天详情
 * @param data 
 * @returns 
 */
export async function getRoleChatDetailsListApi(data: GetRoleChatDetailsListApiProps) {
    return request(api + `/gameData/role/chatDetailListOfPage`, {
        method: 'POST',
        data
    });
}