feat(hero): 英雄详情页面增加套装和神器统计功能

- 新增英雄详情接口,包含60级属性、套装平均属性、套装占比、神器占比等信息- 优化数据处理逻辑,提高查询效率
- 增加缓存机制,减少数据库访问- 新增数据传输对象HeroSetData和HeroSetItem,用于处理套装数据
This commit is contained in:
hxt
2025-06-22 22:29:12 +08:00
parent 61cb21fdc7
commit e0cd5d3428
5 changed files with 404 additions and 15 deletions

View File

@@ -0,0 +1,28 @@
package dto
type HeroSetData struct {
Data []HeroSetItem `json:"data"`
}
type HeroSetItem struct {
ArtifactCode string `json:"artifactCode"`
Atk int `json:"atk"`
Chc int `json:"chc"`
Chd int `json:"chd"`
CreateDate string `json:"createDate"`
Def int `json:"def"`
Eff int `json:"eff"`
Efr int `json:"efr"`
Gs int `json:"gs"`
Hp int `json:"hp"`
Speed int `json:"spd"` // 注意字段名 spd 在 json 中是 speed
UnitCode string `json:"unitCode"`
UnitName string `json:"unitName"`
Sets map[string]int `json:"sets"` // 动态套装类型
SetsName string `json:"setsName"` // 解析后触发的套装效果名称,例如 "速度,生命"
}
type HeroSetGroup struct {
SetImmune int `json:"set_immune"`
SetVampire int `json:"set_vampire"`
}