武将攻略:武将对比
This commit is contained in:
@@ -25,6 +25,9 @@ import { JewelModel } from "../../../db/Jewel";
|
||||
import { getHeroesAttributes } from "../../../services/playerCeService";
|
||||
import { sendMessageToUsersWithSuc, sendMessageToUserWithSuc } from "../../../services/pushService";
|
||||
import { PrivateMessageModel } from "../../../db/PrivateMessage";
|
||||
import { RoleCeModel } from "../../../db/RoleCe";
|
||||
import { CalCe } from "../../../services/role/calCe";
|
||||
import { getSchoolPoint } from "../../../services/roleService";
|
||||
|
||||
|
||||
export default function (app: Application) {
|
||||
@@ -730,14 +733,21 @@ export class FriendHandler {
|
||||
|
||||
let { roleId: hisRoleId, hids } = msg;
|
||||
|
||||
let role = await RoleModel.findByRoleId(hisRoleId, ROLE_SELECT.ATTR);
|
||||
let role = await RoleModel.findByRoleId(hisRoleId, 'title');
|
||||
if (!role) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||
|
||||
let roleCe = await RoleCeModel.findByRoleId(hisRoleId);
|
||||
if (!roleCe) return resResult(STATUS.ROLE_NOT_FOUND);
|
||||
|
||||
let heroList = await HeroModel.findByHidRange(hids, hisRoleId, HERO_SELECT.HERO_DETAIL, true);
|
||||
if (heroList.length <= 0) return resResult(STATUS.HERO_NOT_FIND);
|
||||
|
||||
let jewels = await JewelModel.findMapbyRoleAndHids(hisRoleId, hids);
|
||||
|
||||
let school = await getSchoolPoint(hisRoleId);
|
||||
|
||||
let calCe = new CalCe(hisRoleId);
|
||||
calCe.setRoleCe(roleCe);
|
||||
let attrByHid = await getHeroesAttributes(hisRoleId);
|
||||
let list: HeroDetailParam[] = [];
|
||||
for (let hero of heroList) {
|
||||
@@ -747,9 +757,18 @@ export class FriendHandler {
|
||||
let heroParam = new HeroDetailParam(hero);
|
||||
heroParam.setAttributes(attributes);
|
||||
heroParam.setJewels(jewels);
|
||||
|
||||
heroParam.setRole(
|
||||
role.title,
|
||||
calCe.calSingleGlobalPartCe(hero.hid, 'scroll'),
|
||||
calCe.calSingleGlobalPartCe(hero.hid, 'teraph'),
|
||||
school
|
||||
);
|
||||
|
||||
list.push(heroParam);
|
||||
}
|
||||
|
||||
|
||||
return resResult(STATUS.SUCCESS, { list });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user