goweb/route/test.go
2021-08-22 00:13:00 +08:00

20 lines
450 B
Go

package route
import (
"github.com/gin-gonic/gin"
"goweb/core"
"goweb/middleware"
)
func initTestRoute(r *gin.RouterGroup) {
group := r.Group("/test", middleware.AuthorizeJWT())
group.GET("/pub", func(context *gin.Context) {
core.R(context).OkWithMessage("已登录且无需权限可访问")
})
group.GET("/hello", middleware.AuthorityVerify(), func(context *gin.Context) {
core.R(context).OkWithMessage("已登录且有权限")
})
}