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

/**
 * 分页获取账号列表
 * @returns 
 */
export interface GetAdAccountParams {
    pageNum: number,
    pageSize: number,
    groupId?: number,
    accountIds?: string[] | string
    putUserId?: number,
    addV3?: boolean,
    adUnitAccount?: boolean
    adUnitType?: string
}
export async function getAdAccountListApi(data: GetAdAccountParams) {
    return request(api + '/adq/adAccount/accountListOfNovel', {
        method: 'POST',
        data
    });
}

export async function getAdAccountGameListApi(data: GetAdAccountParams) {
    return request(api + '/adq/adAccount/accountListOfGame', {
        method: 'POST',
        data
    });
}

/**
 * 获取账号列表
 * @returns 
 */
export async function getAdAccountApi() {
    return request(api + '/adq/adAccount/allOfUserOfNovel', {
        method: 'GET',
    });
}

/**
 * 返回自己所有账号
 * @returns 
 */
export async function getAllUserAccountApi() {
    return request(api + '/adq/adAccount/allOfOwnerUser', {
        method: 'GET',
    });
}

/**
 * 获取账号列表
 * @returns 
 */
export async function putAdAccountApi(adAccountId: any,remark: any) {
    return request(api + `/adq/adAccount/modifyRemark/${adAccountId}/${encodeURIComponent(remark)}`, {
        method: 'PUT',
    });
}