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 MediaPromotionTotalProps extends Paging, SortProps {
    amountBeginDate?: string
    amountEndDate?: string
    gameCp?: string,
    gameId?: number,
    gameType?: number,
    beginDate?: string,    // 消耗开始时间
    endDate?: string,
    pitcherId?: number,   // 投手ID
    accountType?: string
}
/**
 * 推广媒体总数居
 * @param data 
 * @returns 
 */
export async function getMediaPromotionTotalListApi(data: MediaPromotionTotalProps) {
    return request(wapi + `/media/pitcherGame/total`, {
        method: 'POST',
        data
    });
}

/**
 * 推广媒体总数居总计
 * @param data 
 * @returns 
 */
export async function getMediaPromotionTotalSumApi(data: MediaPromotionTotalProps) {
    return request(wapi + `/media/pitcherGame/totalSum`, {
        method: 'POST',
        data
    });
}

export interface MediaPromotionDayProps extends Paging, SortProps {
    beginDate?: string,    // 消耗开始时间
    endDate?: string,
    pitcherId?: number,   // 投手ID
    accountType?: string,
    gameCp?: string,
    gameId?: number
    gameType?: number
}
/**
 * 推广每日数据数居
 * @param data 
 * @returns 
 */
export async function getMediaPromotionDayListApi(data: MediaPromotionDayProps) {
    return request(wapi + `/media/pitcherGame/day`, {
        method: 'POST',
        data
    });
}
/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getMediaPromotionDayTotalApi(data: MediaPromotionDayProps) {
    return request(wapi + `/media/pitcherGame/dayTotal`, {
        method: 'POST',
        data
    });
}



export interface MediaPitcherDayProps extends Paging, SortProps {
    beginDate?: string,    // 消耗开始时间
    endDate?: string,
    pitcherId?: number,   // 投手ID
    accountType?: string
}
/**
 * 投手每日数据数居
 * @param data 
 * @returns 
 */
export async function getMediaPitcherDayListApi(data: MediaPitcherDayProps) {
    return request(wapi + `/media/pitcher/day`, {
        method: 'POST',
        data
    });
}
/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getMediaPitcherTotalApi(data: MediaPitcherDayProps) {
    return request(wapi + `/media/pitcher/dayTotal`, {
        method: 'POST',
        data
    });
}



export interface MediaPitcherTotalProps extends Paging, SortProps {
    amountBeginDate?: string,    // 充值开始时间
    amountEndDate?: string,
    beginDate?: string,    // 消耗开始时间
    endDate?: string,
    pitcherId?: number,   // 投手ID
    accountType?: string
}
/**
 * 投手总数据数居
 * @param data 
 * @returns 
 */
export async function getMediaPitcherTotalListApi(data: MediaPitcherTotalProps) {
    return request(wapi + `/media/pitcher/total`, {
        method: 'POST',
        data
    });
}
/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getMediaPitcherTotalSumApi(data: MediaPitcherTotalProps) {
    return request(wapi + `/media/pitcher/totalSum`, {
        method: 'POST',
        data
    });
}




export interface MediaGameDayProps extends Paging, SortProps {
    beginDate?: string,    // 消耗开始时间
    endDate?: string,
    accountType?: string
    gameCp?: string,
    gameId?: number,
    gameType?: number
}
/**
 * 游戏媒体每日数居
 * @param data 
 * @returns 
 */
export async function getMediaGameDayListApi(data: MediaGameDayProps) {
    return request(wapi + `/media/game/day`, {
        method: 'POST',
        data
    });
}
/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getMediaGameDayTotalApi(data: MediaGameDayProps) {
    return request(wapi + `/media/game/dayTotal`, {
        method: 'POST',
        data
    });
}



export interface MediaGameTotalProps extends Paging, SortProps {
    amountBeginDate?: string,    // 充值开始时间
    amountEndDate?: string,
    beginDate?: string,    // 消耗开始时间
    endDate?: string,
    accountType?: string
    gameCp?: string,
    gameId?: number,
    gameType?: number
}
/**
 * 游戏媒体总数据
 * @param data 
 * @returns 
 */
export async function getMediaGameTotalListApi(data: MediaGameTotalProps) {
    return request(wapi + `/media/game/total`, {
        method: 'POST',
        data
    });
}
/**
 * 总计
 * @param data 
 * @returns 
 */
export async function getMediaGameTotalSumApi(data: MediaGameTotalProps) {
    return request(wapi + `/media/game/totalSum`, {
        method: 'POST',
        data
    });
}


export interface MediumActiveDataProps extends Paging, SortProps {
    activeTypes: ActiveEnum,
    classify?: number,
    gameId?: number,
    // 注册开始时间
    registeredBeginDate?: string,
    registeredEndDate?: string,
    accountType?: string
}
/**
 * 媒体留存数据
 * @param data 
 * @returns 
 */
export async function getMediumActiveDataListApi(data: MediumActiveDataProps) {
    return request(wapi + `/gameData/mediaActiveData/day`, {
        method: 'POST',
        data
    });
}

/**
 * 媒体留存总计
 * @param data 
 * @returns 
 */
export async function getMediumActiveDataTotalApi(data: MediumActiveDataProps) {
    return request(wapi + `/gameData/mediaActiveData/total`, {
        method: 'POST',
        data
    });
}