import { ApiCall } from "tsrpc";
import { ReqGetUser, ResGetUser } from "../../cross/protocols/hbzb/PtlGetUser";

/**
 * 从跨服中获取uids对应的数据
 * @param call 
 */
export default async function (call: ApiCall<ReqGetUser, ResGetUser>) {
    let uids = call.req.uids;
    let res = {};
    let arr = await G.mongodb.collection('hbzb_user_cross').find({
        uid: {
            $in: uids
        }
    }).toArray();

    arr.map(i=>{
        res[i.uid] = {
            data: i.data,
            jifen:i.jifen,
        };
    });

    call.succ(res);
}