Files
epic-go/internal/model/dto/third_party.go
hu xiaotong b8c9817cb3 i18n翻译
2025-07-14 17:14:58 +08:00

94 lines
2.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package dto
// ThirdPartyArtifactDTO represents an artifact from the third-party API.
type ThirdPartyArtifactDTO struct {
ID string `json:"_id"`
Name string `json:"name"`
Code string `json:"code"`
Rarity int `json:"rarity"`
Exclusive string `json:"exclusive"`
AtkBase int `json:"atk_base"`
AtkMax int `json:"atk_max"`
HPBase int `json:"hp_base"`
HPMax int `json:"hp_max"`
SkillDesc string `json:"skill_desc"`
SkillDescMax string `json:"skill_desc_max"`
}
// ThirdPartyHeroDTO represents a hero from the third-party API.
// Note: This is a placeholder structure. Adjust it according to the actual API response.
// ThirdPartyHeroDTO 第三方英雄数据传输对象
type ThirdPartyHeroDTO struct {
Code string `json:"code"`
ID string `json:"_id"`
Name string `json:"-"`
Rarity int `json:"rarity"`
Attribute string `json:"attribute"`
Role string `json:"role"`
Zodiac string `json:"zodiac"`
SelfDevotion SelfDevotion `json:"self_devotion"`
Assets Assets `json:"assets"`
ExEquip []ExEquip `json:"ex_equip"`
Skills Skills `json:"skills"`
CalculatedStatus CalculatedStatus `json:"calculatedStatus"`
}
// Skills结构体支持点语法访问S1、S2、S3
type Skills struct {
S1 Skill `json:"S1"`
S2 Skill `json:"S2"`
S3 Skill `json:"S3"`
}
// 新增结构体,支持点语法访问
// CalculatedStatus 兼容第三方API的calculatedStatus字段
// 只声明常用的两个等级
// 其他等级如有需要可自行添加
// 字段名需与json tag严格对应
type CalculatedStatus struct {
Lv50FiveStarFullyAwakened Stats `json:"lv50FiveStarFullyAwakened"`
Lv60SixStarFullyAwakened Stats `json:"lv60SixStarFullyAwakened"`
}
type SelfDevotion struct {
Type string `json:"type"`
Grades map[string]float64 `json:"grades"`
}
type Assets struct {
Icon string `json:"icon"`
Image string `json:"image"`
Thumbnail string `json:"thumbnail"`
}
type ExEquip struct {
Stat struct {
Type string `json:"type"`
Value float64 `json:"value"`
} `json:"stat"`
}
type Skill struct {
HitTypes []string `json:"hitTypes"`
Rate float64 `json:"rate,omitempty"`
Pow float64 `json:"pow,omitempty"`
Targets int `json:"targets,omitempty"`
SelfHpScale float64 `json:"selfHpScaling,omitempty"`
SelfDefScale float64 `json:"selfDefScaling,omitempty"`
Options []any `json:"options"`
}
type Stats struct {
CP int `json:"cp"`
ATK int `json:"atk"`
HP int `json:"hp"`
SPD int `json:"spd"`
DEF int `json:"def"`
CHC float64 `json:"chc"`
CHD float64 `json:"chd"`
DAC float64 `json:"dac"`
EFF int `json:"eff"`
EFR int `json:"efr"`
}