✨ feat(gvg): 激战期挑战相关接口整理

This commit is contained in:
luying
2023-02-17 10:59:38 +08:00
parent c0cc85ae0a
commit a838aba8e5
12 changed files with 316 additions and 129 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ class TeamInfo {
teamCode: string; // 玩家队伍唯一标识
@prop({ required: true })
teamId: number; // 队伍id,1-3,玩家的第几个队伍
index: number; // 队伍id,1-3,玩家的第几个队伍
@prop({ required: true })
leagueCode: string; // 联军
@@ -62,7 +62,7 @@ export default class GVGBattleRec extends BaseModel {
public static async createRec(attackTeam: GVGTeamType, defenseTeam: GVGTeamType) {
const battleCode = genCode(8);
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { attackTeam, defenseTeam, isSuccess: false } }).lean();
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { attackTeam, defenseTeam, isSuccess: false } }, { new: true, upsert: true }).lean();
return result;
}