import request from "@/utils/request";
const { api } = process.env.CONFIG;

/**
 * 用户重粉次数统计 企业维度
 * @returns 
 */
export function getExternalUserRepeatCorpApi() {
    return request({
        url: api + `/corpOperation/ads/corp/externalUserRepeatCorp`,
        method: 'GET'
    })
}

/**
 * 用户重粉次数统计 客服号维度
 * @returns 
 */
export function getExternalUserRepeatCorpUserApi() {
    return request({
        url: api + `/corpOperation/ads/corp/externalUserRepeatCorpUser`,
        method: 'GET'
    })
}

/**
 * 单主体内粉丝前20总用户数,主体内重粉数
 * @returns 
 */
export function getExternalUserRepeatByCorpAtlasApi() {
    return request({
        url: api + `/corpOperation/ads/corp/externalUserRepeatByCorp/atlas`,
        method: 'GET'
    })
}

/**
 * 用户重粉次数统计 主体维度
 * @returns 
 */
export function getCorpExternalUserRepeatListApi(data: { pageNum: number, pageSize: number, corpName?: string, sortType?: string, orderByField?: string }) {
    return request({
        url: api + `/corpOperation/ads/corp/corpExternalUserRepeat`,
        method: 'POST',
        data
    })
}

/**
 * 主体重粉率统计
 * @param data 
 * @returns 
 */
export function getExternalUserRepeatByCorpListApi(data: { pageNum: number, pageSize: number, corpName?: string, sortType?: string, orderByField?: string }) {
    return request({
        url: api + `/corpOperation/ads/corp/externalUserRepeatByCorp`,
        method: 'POST',
        data
    })
}

export interface GetExternalUserRepeatByCorpListApiProps {
    pageNum: number,
    pageSize: number,
    corpName?: string,
    name?: string,
    minCorpIdCount?: number,
    maxCorpIdCount?: number,
    minCorpUserIdCount?: number,
    maxCorpUserIdCount?: number,
    sortType?: string,
    orderByField?: string
    corpIdList?: string[]
}

/**
 * Uuid维度统计列表
 * @param data 
 * @returns 
 */
export function getSelectQcUuidStatisticPageListApi(data: GetExternalUserRepeatByCorpListApiProps) {
    return request({
        url: api + `/corpOperation/ads/corp/selectQcUuidStatisticPage`,
        method: 'POST',
        data
    })
}

/**
 * 企业id个数 详情
 * @param params 
 * @returns 
 */
export function getSelectCorpIdsByQcUuidListApi(params: { qcUuid: string }) {
    return request({
        url: api + `/corpOperation/ads/corp/selectCorpIdsByQcUuid`,
        method: 'GET',
        params
    })
}

/**
 * 客服号id个数详情
 * @param params 
 * @returns 
 */
export function getSelectCorpUserIdsByQcUuidListApi(params: { qcUuid: string }) {
    return request({
        url: api + `/corpOperation/ads/corp/selectCorpUserIdsByQcUuid`,
        method: 'GET',
        params
    })
}