寻宝:添加新接口,同时获取藏宝图数量和助战次数

This commit is contained in:
liangtongchuan
2021-01-13 16:32:28 +08:00
parent e434f2a621
commit b992d3c7b6

View File

@@ -348,23 +348,6 @@ export class ComBattleHandler {
return resResult(STATUS.SUCCESS, { teamInfos: teams});
}
/**
* @description 获取今日已助战次数
* @param {{}} msg
* @param {BackendSession} session
* @returns
* @memberof ComBattleHandler
*/
async getAssistCnt(msg: {}, session: BackendSession) {
let roleId = session.get('roleId');
let cntMap = await getAssistTimesByQuality(roleId);
let cnt = [];
for (let i = 0; i < 5; ++i) {
cnt[i] = cntMap.get(i + 1) || 0;
}
return resResult(STATUS.SUCCESS, {cnt});
}
/**
* @description 队伍准备-deprecate
* @param {{teamCode: string, heroes: Array<number>}} msg
@@ -779,6 +762,40 @@ export class ComBattleHandler {
return resResult(STATUS.SUCCESS, { blueprts });
}
/**
* @description 获取今日已助战次数
* @param {{}} msg
* @param {BackendSession} session
* @returns
* @memberof ComBattleHandler
*/
async getAssistCnt(msg: {}, session: BackendSession) {
let roleId = session.get('roleId');
let cntMap = await getAssistTimesByQuality(roleId);
let cnt = [];
for (let i = 0; i < 5; ++i) {
cnt[i] = cntMap.get(i + 1) || 0;
}
return resResult(STATUS.SUCCESS, {cnt});
}
/**
* @description 获取寻宝可用次数,包含藏宝图数量和助战次数,分别用于创建和加入队伍
* @param {{}} msg 无参数
* @param {BackendSession} session
* @returns
* @memberof ComBattleHandler
*/
async getComBtlCnt(msg: {}, session: BackendSession) {
let roleId = session.get('roleId');
let cntMap = await getAssistTimesByQuality(roleId);
let cnt = [];
for (let i = 0; i < 5; ++i) {
cnt[i] = cntMap.get(i + 1) || 0;
}
const blueprts = await ItemModel.findByRoleAndType(roleId, CONSUME_TYPE.BLUEPRT);
return resResult(STATUS.SUCCESS, { blueprts, assistCnt: cnt });
}
/**
* @description 藏宝图合成
* @param {{original: Array<{id: number, count: number}>}} msg