Files
epic-go/api/hero/v1/hero.go
hxt 1fbea6ad9f feat(internal): 添加 CORS 支持并更新 API 路径- 在 cmd.go 中添加了 CORS 中间件,用于支持跨域请求
- 更新了 hero.go 中的 API 路径,使其符合新的命名规范
- 优化了 hero_v1.go 中的响应构造方式,提高了代码效率
2025-06-22 23:50:57 +08:00

29 lines
708 B
Go

package v1
import (
"epic/internal/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type GetOneReq struct {
g.Meta `path:"/getOne" method:"get" tags:"Hero" summary:"Get one hero"`
Code string `v:"required" dc:"角色code"`
}
type GetOneRes struct {
*entity.EpicHeroInfo
}
// GetListReq GetListRes 列表返回所有角色
type GetListReq struct {
g.Meta `path:"/app-api/epic/hero/list-all" method:"get" tags:"Hero" summary:"Get all hero"`
}
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"`
}
type GetDetailRes struct {
*HeroDetailVO
}