import { ApiCall } from "tsrpc";
import { Reqgetdata, Resgetdata } from "../../monopoly/protocols/user/Ptlgetdata";

export default async function (call: ApiCall<Reqgetdata, Resgetdata>) {
    let uid = call.req.user_id;

    // 无此玩家
    let getgud = await G.mongodb.collection('user').findOne({ uid: uid });
    if (!getgud) {
        return call.error('', { code: 1002, message: globalThis.lng.wuciwanjia });
    }
    let { _id, ...gud } = getgud;

    call.succ({ message: "导出玩家数据成功", code: 0, data: gud });
}