import {requestClient} from "#/api/request";

interface ApiResultListData {
    data: Object;
    status: number;
    total: number;
    list: Array<any>;
}

interface ApiResultInfoData {
    data: Object;
    status: number;
}

/**
 * 获取玩家列表
 */
export async function getPlayerList(data:any) {
    const params = new URLSearchParams(data); // 创建一个新的URLSearchParams对象
    const queryString = params.toString(); // 转换为查询字符串
    return requestClient.get<ApiResultListData>('/player/list?' + queryString, {
        // withCredentials: true,
    });
}

/**
 * 获取玩家详情
 */
export async function getPlayerInfo(user_id:string | number) {
    return requestClient.get<ApiResultInfoData>('/player/detail?player_id=' + user_id, {
        // withCredentials: true,
    });
}