feat:插件模式尝鲜

This commit is contained in:
songzhibin97
2021-08-20 19:32:25 +08:00
parent 1d11b9a0c0
commit c5c8032975
4 changed files with 159 additions and 28 deletions

View 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"
}