优化结构
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# Server Layer
|
||||
|
||||
The root package owns Gin server lifecycle and Swagger setup. HTTP concerns are
|
||||
grouped by role:
|
||||
|
||||
- `handler/`: resource handlers and HTTP boundary validation
|
||||
- `middleware/`: request metadata, auth, access control, audit, recovery, CORS
|
||||
- `router/`: resource route registration and the system route registrar
|
||||
- `httpx/`: system adapter for shared response and cookie helpers
|
||||
|
||||
Keep new files in the matching role directory instead of adding transport files
|
||||
to the root package.
|
||||
@@ -19,7 +19,7 @@ func RegisterAPI(group, public *gin.RouterGroup, engine *gin.Engine, h *API) {
|
||||
api.GET("/syncApi", h.Sync(engine))
|
||||
api.POST("/ignoreApi", h.Ignore)
|
||||
api.POST("/enterSyncApi", h.ApplySync)
|
||||
public.Group("/api").GET("/freshCasbin", h.FreshCasbin)
|
||||
group.Group("/api").GET("/freshCasbin", h.FreshCasbin)
|
||||
casbin := group.Group("/casbin")
|
||||
casbin.POST("/updateCasbin", h.SetPolicyPaths)
|
||||
casbin.POST("/getPolicyPathByAuthorityId", h.PolicyPaths)
|
||||
|
||||
Reference in New Issue
Block a user