import { ApiCall } from "tsrpc";
import { ReqLog, ResLog } from "../../shared/protocols/kuangdong/PtlLog";

export default async function (call: ApiCall<ReqLog, ResLog>) {
    /**查询所有抽奖日志 */
    let result = (await G.mongodb.collection('ghbzcjlog').findOne({ type: "kuangdong_msg" })) || { list: [] }
    let _res = []
    if (result.list.length > 0) {
        for (let index = 0; index < result.list.length; index++) {
            const element = result.list[index];
            if (element.uid == call.uid) {
                _res.push(element)
            }
        }
    }

    call.succ({
        kuangdonglog: _res
    });
}