✨ feat(战场): 保存战阵连携顺序
This commit is contained in:
@@ -8,6 +8,7 @@ import { DicGVGAreaPoint } from "../pubUtils/dictionary/DicGVGAreaPoint";
|
||||
import { InitTeamParam, SaveTeamUpdateParam } from "../domain/gvgField/gvgDb";
|
||||
import { GVGHeroInfo } from "../domain/dbGeneral";
|
||||
import { GVG_BATTLE_PRE_TIME, GVG_CATAPULT, GVG_ROBOT } from "../consts";
|
||||
import { Combo } from "../domain/battleField/pvp";
|
||||
|
||||
@index({ roleId: 1, index: 1 })
|
||||
@index({ teamCode: 1 })
|
||||
@@ -110,6 +111,9 @@ export default class GVGTeam extends BaseModel {
|
||||
@prop({ required: true, type: () => GVGHeroInfo, _id: false })
|
||||
lineup: GVGHeroInfo[];
|
||||
|
||||
@prop({ required: true, type: () => Combo, _id: false })
|
||||
combo: Combo[];
|
||||
|
||||
@prop({ required: true })
|
||||
lineupCe: number;
|
||||
|
||||
@@ -137,6 +141,7 @@ export default class GVGTeam extends BaseModel {
|
||||
const teamCode = genCode(8);
|
||||
const insert = Object.assign(doc.toJSON(), { ...initParam, teamCode });
|
||||
delete insert.lineup;
|
||||
delete insert.combo;
|
||||
const team: GVGTeamType | null = await GVGTeamModel.findOneAndUpdate({ roleId, index }, { $setOnInsert: insert, $set: updateParam }, { upsert: true, new: true }).lean();
|
||||
return team;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user