后台:日志修改
This commit is contained in:
+10
-2
@@ -1,5 +1,6 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, ReturnModelType, mongoose } from '@typegoose/typegoose';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
|
||||
/**
|
||||
* GM用户组接口
|
||||
@@ -12,17 +13,24 @@ export default class GMRecord extends BaseModel {
|
||||
@prop({ required: true })
|
||||
uid: number;
|
||||
|
||||
@prop({ required: true })
|
||||
env: string;
|
||||
|
||||
@prop({ required: true })
|
||||
api: string;
|
||||
|
||||
@prop({ required: true })
|
||||
apiName: string;
|
||||
|
||||
@prop({ required: true })
|
||||
body: string;
|
||||
|
||||
@prop({ required: true })
|
||||
result: string;
|
||||
|
||||
public static async createRecord(uid: number, api: string, body: string, result: string) {
|
||||
const r = await GMRecordModel.insertMany({uid, api, body, result});
|
||||
public static async createRecord(uid: number, env: string, api: string, body: string, result: string) {
|
||||
let dicApi = gameData.apiByUrl.get(api);
|
||||
const r = await GMRecordModel.insertMany({uid, env, api, apiName: dicApi?.name, body, result});
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user