Skip to content

Commit

Permalink
fix(gen): fix route2Code (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronnie authored Dec 3, 2024
1 parent 010d8a9 commit d6ea0df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/gen/genapi/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ func (ja *JzeroApi) genRoute2Code() ([]byte, error) {
for _, s := range ja.ApiSpecMap {
for _, g := range s.Service.Groups {
for _, r := range g.Routes {
routes = append(routes, Route{
route := Route{
Group: g.GetAnnotation("group"),
Route: r,
})
}
if g.GetAnnotation("prefix") != "" {
route.Path = g.GetAnnotation("prefix") + r.Path
}
routes = append(routes, route)
}
}
}
Expand Down

0 comments on commit d6ea0df

Please sign in to comment.