Merge remote-tracking branch 'origin/feature/dadian' into release

This commit is contained in:
dy 2023-12-22 22:40:03 +08:00
commit a4a84aba24
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import {ApiCall} from "tsrpc";
import {ReqDot, ResDot} from "../../shared/protocols/user/PtlDot";
import {addGameDot} from "../../gameLog";
export default async function (call: ApiCall<ReqDot, ResDot>) {
addGameDot(call.uid, call.req.type, call.req.data)
call.succ({});
}

View File

@ -43,4 +43,30 @@ export async function addGameLog(uid:string, type:string, req:any, data:any){
}catch(e){
console.error('addGameLog',e);
}
}
/**
*
* @param uid uid
* @param type
* @param data
*/
export async function addGameDot(uid:string, type:string, data?:any){
try{
if(!logDB){
await connGameLogDB();
}
let log = {
uid,
type,
data
}
//事件时间
log['cTime'] = Math.floor(Date.now()/1000);
logDB.collection('gameDot').insertOne(log);
}catch(e){
console.error('addGameLog',e);
}
}

View File

@ -0,0 +1,8 @@
export interface ReqDot {
type: string,
data?: any
}
export interface ResDot {
}