Some checks failed
		
		
	
	Build / build (push) Has been cancelled
				
			CodeQL / Analyze (go) (push) Has been cancelled
				
			build / Build (push) Has been cancelled
				
			GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
				
			GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
				
			Issue Close Require / issue-close-require (push) Has been cancelled
				
			Issue Check Inactive / issue-check-inactive (push) Has been cancelled
				
			
		
			
				
	
	
		
			32 lines
		
	
	
		
			785 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			785 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package router
 | |
| 
 | |
| import (
 | |
| 	"github.com/gin-gonic/gin"
 | |
| 	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
 | |
| 
 | |
| 	"go-admin/app/admin/apis"
 | |
| 	"go-admin/common/middleware"
 | |
| )
 | |
| 
 | |
| func init() {
 | |
| 	routerCheckRole = append(routerCheckRole, registerSysRoleRouter)
 | |
| }
 | |
| 
 | |
| // 需认证的路由代码
 | |
| func registerSysRoleRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
 | |
| 	api := apis.SysRole{}
 | |
| 	r := v1.Group("/role").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
 | |
| 	{
 | |
| 		r.GET("", api.GetPage)
 | |
| 		r.GET("/:id", api.Get)
 | |
| 		r.POST("", api.Insert)
 | |
| 		r.PUT("/:id", api.Update)
 | |
| 		r.DELETE("", api.Delete)
 | |
| 	}
 | |
| 	r1 := v1.Group("").Use(authMiddleware.MiddlewareFunc())
 | |
| 	{
 | |
| 		r1.PUT("/role-status", api.Update2Status)
 | |
| 		r1.PUT("/roledatascope", api.Update2DataScope)
 | |
| 	}
 | |
| }
 |