sys_api.go 573 B

123456789101112131415161718192021222324
  1. package router
  2. import (
  3. "github.com/gin-gonic/gin"
  4. jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
  5. "go-admin/app/admin/apis"
  6. "go-admin/common/middleware"
  7. )
  8. func init() {
  9. routerCheckRole = append(routerCheckRole, registerSysApiRouter)
  10. }
  11. // registerSysApiRouter
  12. func registerSysApiRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
  13. api := apis.SysApi{}
  14. r := v1.Group("/sys-api").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
  15. {
  16. r.GET("", api.GetPage)
  17. r.GET("/:id", api.Get)
  18. r.PUT("/:id", api.Update)
  19. }
  20. }