添加主线关卡和每日关卡
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop } from '@typegoose/typegoose';
|
||||
|
||||
/**
|
||||
* 战斗记录接口
|
||||
*/
|
||||
@index({ roleId: 1, battleId: 1 })
|
||||
|
||||
export default class BattleSweepRecord extends BaseModel {
|
||||
@prop({ required: true })
|
||||
roleId: string; // 角色 id
|
||||
@prop({ required: true })
|
||||
roleName: string; // 角色名称
|
||||
|
||||
@prop({ required: true })
|
||||
battleId: number; // 关卡 id
|
||||
@prop({ required: true })
|
||||
warName: string; // 关卡 名
|
||||
@prop({ required: true })
|
||||
warType: number; // 关卡 类型
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
count: number; // 扫荡次数
|
||||
|
||||
public static async saveBattleSweepRecordById(roleId: string, battleId: number, params: any, lean = true) {
|
||||
const result = await BattleSweepRecordModel.findOneAndUpdate({ roleId, battleId }, params, {new: true, upsert: true}).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const BattleSweepRecordModel = getModelForClass(BattleSweepRecord);
|
||||
Reference in New Issue
Block a user