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

export default async function (call: ApiCall<ReqOpen, ResOpen>) {
    // 返回幸运值

    let data = await G.mongodb.collection('gbtx').findOne({ uid: call.uid }) || { luck: {}, _id: null, uid: '', fightNum: {} };
    let { _id, uid, ...ops } = data;

    G.redis.set('gbtx', call.uid, ops);
    call.succ({
        luck: data.luck
    });
}