import { request } from 'umi';
import { api } from '../api';


export interface GetCorpUserDayListProps {
    pageNum: number,
    pageSize: number,
    day?: string,
    corpIdList?: string[]
    corpUserName?: string
    sortFiled?: string,
    sortAsc?: boolean
    addFansMin?: number | null
    addFansMax?: number | null
    localCsgroupId?: number
    poolType?: string
}

/**
 * 客服号天数据 
 * @param data 
 * @returns 
 */
export async function getCorpUserDayListApi(data: GetCorpUserDayListProps) {
    return request(api + `/tencentMonitor/corpUser/day/listOfPage`, {
        method: 'POST',
        data
    })
}

export interface GetCorpUserDayHourListProps {
    day: string,
    corpId: string
    corpUserId: string
}

/**
 * 客服号小时数据
 * @param data 
 * @returns 
 */
export async function getCorpUserDayHourListApi(data: GetCorpUserDayHourListProps) {
    return request(api + `/tencentMonitor/corpUser/day/hour/list`, {
        method: 'POST',
        data
    })
}

export interface GetLocalCsgroupDayListProps {
    pageNum: number,
    pageSize: number,
    day?: string,
    localCsgroupId?: number,
    sortFiled?: string,
    sortAsc?: boolean
}

/**
 * 本地客服组天数据
 * @param data 
 * @returns 
 */
export async function getLocalCsgroupDayListApi(data: GetLocalCsgroupDayListProps) {
    return request(api + `/tencentMonitor/localCsgroup/day/listOfPage`, {
        method: 'POST',
        data
    })
}

/**
 * 本地客服组单条天数据对应的小时数据
 * @param data 
 * @returns 
 */
export async function getLocalCsgroupDayHourListApi(data: { day: string, localCsgroupId: number }) {
    return request(api + `/tencentMonitor/localCsgroup/day/hour/list`, {
        method: 'POST',
        data
    })
}

export interface GetCorpUserLogListProps {
    pageNum: number,
    pageSize: number,
    uuid?: string,
    outlineCorpUserId?: string,
    localCsgroupId?: number,
    dataTimeStart?: string,
    dataTimeEnd?: string,
    sortFiled?: string,
    sortAsc?: boolean
}

/**
 * 客服号消息数据
 * @param data 
 * @returns 
 */
export async function getCorpUserLogListApi(data: GetCorpUserLogListProps) {
    return request(api + `/tencentMonitor/corpUser/log/list`, {
        method: 'POST',
        data
    })
}

/**
 * 本地客服组单条天数据对应的索引数据
 * @param data 
 * @returns 
 */
export async function getLocalCsgroupDayIndexListApi(data: { pageNum: number, pageSize: number, day: string, localCsgroupId: number, sortFiled?: string, sortAsc?: boolean }) {
    return request(api + `/tencentMonitor/localCsgroup/index/listOfPage`, {
        method: 'POST',
        data
    })
}