✨ feat(录像): 修改录像上传逻辑
This commit is contained in:
@@ -97,6 +97,9 @@ export default class GVGBattleRec extends BaseModel {
|
||||
@prop({ required: true, default: false })
|
||||
hasRpl: boolean; // 是否存在对应录像
|
||||
|
||||
@prop({ required: true, default: false })
|
||||
remoteUrl: string; // 录像地址
|
||||
|
||||
public static async createRec(configId: number, groupKey: string, warId: number, attackTeam: GVGTeamType, defenseTeam: GVGTeamType) {
|
||||
const battleCode = genCode(8);
|
||||
const result: GVGBattleRecType = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { $set: { configId, groupKey, warId, attackTeam, defenseTeam, isSuccess: false } }, { new: true, upsert: true }).lean();
|
||||
@@ -113,8 +116,8 @@ export default class GVGBattleRec extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async updateRplStatus(battleCode: string, hasRpl: boolean) {
|
||||
let result = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { hasRpl }, { new: true }).lean();
|
||||
public static async updateRplStatus(battleCode: string, hasRpl: boolean, remoteUrl: string) {
|
||||
let result = await GVGBattleRecModel.findOneAndUpdate({ battleCode }, { hasRpl, remoteUrl }, { new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user