红点:修改推送方式

This commit is contained in:
luying
2021-05-31 13:29:58 +08:00
parent 44d9e80640
commit a8eebc200c
38 changed files with 805 additions and 605 deletions

View File

@@ -10,7 +10,7 @@ import { getAtrrNameById } from '../../../consts/constModules/abilityConst'
import { findIndex } from 'underscore';
import { SclResultInter, SclPosInter } from '../../../pubUtils/interface';
import { SchoolModel } from '../../../db/School';
import { checkTeraphMaterialEnough } from '../../../services/roleService'
import { checkTeraphMaterialEnough, getSchoolList } from '../../../services/roleService'
import { calPlayerCeAndSave, calAllHeroCe } from '../../../services/playerCeService';
import { HERO_SYSTEM_TYPE, LINEUP_NUM, ROLE_SELECT, REDIS_KEY, TASK_TYPE, DEFAULT_HEROES, DEFAULT_HERO_LV, DEFAULT_ITEMS, DEFAULT_EQUIPS, DEFAULT_GOLD, DEFAULT_COIN } from '../../../consts';
import { checkBattleHeroesByHid } from '../../../services/normalBattleService';
@@ -189,38 +189,7 @@ export class RoleHandler {
// 获得百家学宫
async getSchoolList(msg: {}, session: BackendSession) {
let roleId = session.get('roleId');
const dicPosition = decodeIdCntArrayStr(SCHOOL.SCHOOL_POSITION, 1); // id=>isOpen
const userSchoolList = await SchoolModel.findByRoleId(roleId);
let school = new Array<SclResultInter>();
gameData.school.forEach((dicSchool) => {
let position = new Array<SclPosInter>();
dicPosition.forEach((isOpen, dicId) => {
let id = parseInt(dicId);
let userSchool = userSchoolList.find(cur => cur.schoolId == dicSchool.id && cur.positionId == id);
if (userSchool) {
position.push({
id,
hid: userSchool.hid,
isOpen: userSchool.isOpen
});
} else {
position.push({
id,
hid: 0,
isOpen: !!isOpen
});
}
});
school.push({
id: dicSchool.id,
position
});
});
let school = await getSchoolList(roleId);
return resResult(STATUS.SUCCESS, { school });