feat:插件模式尝鲜
This commit is contained in:
16
server/router/example/plugin.go
Normal file
16
server/router/example/plugin.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type Plugin struct {
|
||||
}
|
||||
|
||||
func (*Plugin) Register(group *gin.RouterGroup) {
|
||||
group.GET("hello", func(context *gin.Context) {
|
||||
context.JSON(200, "hello world")
|
||||
})
|
||||
}
|
||||
|
||||
func (*Plugin) RouterPath() string {
|
||||
return "group"
|
||||
}
|
Reference in New Issue
Block a user