import { ApiCall } from "tsrpc";
import { ReqOpen, ResOpen } from "../../shared/protocols/jiaotang/PtlOpen";

export default async function (call: ApiCall<ReqOpen, ResOpen>) {

    let result = await G.mongodb.collection('playerInfo', 'jiaotang').findOne({ uid: call.uid, type: 'jiaotang' });

    call.succ({
        oneNum: result?.oneNum || 0,
        tenNum: result?.tenNum || 0,
        freeTime: result?.freeTime || 0
    });
}