feat✨优化router import
This commit is contained in:
1 parent
13ff9d9e63
commit
ae34ff8f82
14 files changed
+41
-57
No files matched your search
@@ -6,7 +6,7 @@ import (
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/service/dto"
|
||||
"go-admin/common/actions"
|
||||
middleware2 "go-admin/common/middleware"
|
||||
"go-admin/common/middleware"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -16,14 +16,8 @@ func init() {
|
||||
// 需认证的路由代码
|
||||
func registerSysContentRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
|
||||
|
||||
r := v1.Group("/syscontent").Use(authMiddleware.MiddlewareFunc()).Use(middleware2.AuthCheckRole())
|
||||
r := v1.Group("/syscontent").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||
{
|
||||
//r.GET("", sys_content.GetSysContentList)
|
||||
//r.GET("/:id", sys_content.GetSysContent)
|
||||
//r.POST("", sys_content.InsertSysContent)
|
||||
//r.PUT("", sys_content.UpdateSysContent)
|
||||
//r.DELETE("/:id", sys_content.DeleteSysContent)
|
||||
|
||||
model := &models.SysContent{}
|
||||
r.GET("", actions.PermissionAction(), actions.IndexAction(model, new(dto.SysContentSearch), func() interface{} {
|
||||
list := make([]models.SysContent, 0)
|
||||
@@ -34,4 +28,4 @@ func registerSysContentRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMid
|
||||
r.PUT("/:id", actions.PermissionAction(), actions.UpdateAction(new(dto.SysContentControl)))
|
||||
r.DELETE("", actions.PermissionAction(), actions.DeleteAction(new(dto.SysContentById)))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user