Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbirthday committed Dec 3, 2021
1 parent e7358f0 commit fdccdb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routerx/apigroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ type ApiGroup struct {
group *gin.RouterGroup
}

func NewGroup(r *ApiEngine, path string) *ApiGroup {
func (r *ApiGroup) NewGroup(path string) *ApiGroup {
return &ApiGroup{
group: r.engine.Group(path),
group: r.group.Group(path),
}
}

Expand Down
6 changes: 6 additions & 0 deletions routerx/apirouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ type ApiEngine struct {
engine *gin.Engine
}

func Default() *ApiEngine {
return &ApiEngine{
engine: gin.Default(),
}
}

func NewRouter(engine *gin.Engine) *ApiEngine {
return &ApiEngine{
engine: engine,
Expand Down

0 comments on commit fdccdb5

Please sign in to comment.