优化:减少初始以及合成武将时返回的数据

This commit is contained in:
luying
2022-04-07 18:36:46 +08:00
parent f20583125d
commit 3cb5c650e2
13 changed files with 63 additions and 56 deletions
@@ -10,7 +10,7 @@ import { gameData } from '../../pubUtils/data';
import { uniq } from 'underscore';
import { EPlace, HeroModel, HeroType, HeroUpdate } from '../../db/Hero';
import { Figure } from '../../domain/dbGeneral';
import { CreateHeroParam, HeroShowParam } from '../../domain/roleField/hero';
import { CreateHeroParam, HeroShowParam, JewelParam } from '../../domain/roleField/hero';
import { HeroSkin } from '../../db/Hero';
import { errlogger } from '../../util/logger';
import { BAG } from '../../pubUtils/dicParam';
@@ -399,9 +399,7 @@ export async function addJewels(roleId: string, roleName: string, jewels: { id:
}
const jewelResult = await JewelModel.createJewels(roleId, jewelInfo);
return { jewels: jewelResult.map(jewel => {
return { ...jewel, count: 1, inc: 1, reason }
})}
return { jewels: jewelResult.map(jewel => new JewelParam(jewel, true, reason))}
}
export async function getAddJewelInfo(roleId: string, roleName: string, jewel: { id: number, }) {