diff --git a/api/hero/v1/hero.go b/api/hero/v1/hero.go index b504fb4..a53e8de 100644 --- a/api/hero/v1/hero.go +++ b/api/hero/v1/hero.go @@ -20,8 +20,8 @@ type GetListReq struct { type GetListRes []*EpicHeroVO type GetDetailReq struct { - g.Meta `path:"/app-api/epic/hero/hero-detail" method:"get" tags:"Hero" summary:"Get hero detail by code"` - Code string `v:"required" dc:"角色code"` + g.Meta `path:"/app-api/epic/hero/hero-detail" method:"get" tags:"Hero" summary:"Get hero detail by code"` + HeroCode string `v:"required" dc:"角色code"` } type GetDetailRes struct { *HeroDetailVO diff --git a/api/hero/v1/vo.go b/api/hero/v1/vo.go index 000f74a..1e7d3ba 100644 --- a/api/hero/v1/vo.go +++ b/api/hero/v1/vo.go @@ -1,17 +1,17 @@ package v1 type EpicHeroVO struct { - Id int64 `json:"id" orm:"id" description:"文件编号"` // 文件编号 - HeroName string `json:"heroName" orm:"hero_name" description:"配置编号"` // 配置编号 - HeroCode string `json:"heroCode" orm:"hero_code" description:"文件名"` // 文件名 - HeroAttrLv60 string `json:"heroAttrLv60" orm:"hero_attr_lv60" description:"文件路径"` // 文件路径 - NickName string `json:"nickName" orm:"nick_name" description:"配置编号"` // 配置编号 - Rarity string `json:"rarity" orm:"rarity" description:"配置编号"` // 配置编号 - Role string `json:"role" orm:"role" description:"配置编号"` // 配置编号 - Zodiac string `json:"zodiac" orm:"zodiac" description:"配置编号"` // 配置编号 - HeadImgUrl string `json:"headImgUrl" orm:"head_img_url" description:"配置编号"` // 配置编号 - Attribute string `json:"attribute" orm:"attribute" description:"配置编号"` // 配置编号 - Remark string `json:"remark" orm:"remark" description:"配置编号"` // 配置编号 + Id int64 `json:"id"` // 文件编号 + HeroName string `json:"heroName"` // 配置编号 + HeroCode string `json:"heroCode"` // 文件名 + HeroAttrLv60 string `json:"heroAttrLv60"` // 文件路径 + NickName string `json:"nickName"` // 配置编号 + Stars int `json:"stars"` // 配置编号 + Role string `json:"role"` // 配置编号 + Zodiac string `json:"zodiac"` // 配置编号 + HeadImgUrl string `json:"headImgUrl"` // 配置编号 + Attribute string `json:"attribute"` // 配置编号 + Remark string `json:"remark"` // 配置编号 } // HeroRespSimpleVO 简要信息 diff --git a/internal/controller/hero/hero_v1.go b/internal/controller/hero/hero_v1.go index cd62bd0..6c6a772 100644 --- a/internal/controller/hero/hero_v1.go +++ b/internal/controller/hero/hero_v1.go @@ -31,7 +31,7 @@ func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1 } func (c *ControllerV1) GetDetail(ctx context.Context, req *v1.GetDetailReq) (res *v1.GetDetailRes, err error) { - detail, err := service.Hero().GetHeroDetailByCode(ctx, req.Code) + detail, err := service.Hero().GetHeroDetailByCode(ctx, req.HeroCode) if err != nil { return nil, err } diff --git a/internal/logic/hero/hero.go b/internal/logic/hero/hero.go index 7813953..8dde182 100644 --- a/internal/logic/hero/hero.go +++ b/internal/logic/hero/hero.go @@ -73,7 +73,7 @@ func (l *Logic) GetHeroList(ctx context.Context) ([]*v1.EpicHeroVO, error) { HeadImgUrl: hero.HeadImgUrl, HeroAttrLv60: hero.HeroAttrLv60, NickName: hero.NickName, - Rarity: hero.Rarity, + Stars: gconv.Int(hero.Rarity), Role: hero.Role, Zodiac: hero.Zodiac, Remark: hero.Remark,