优化结构

This commit is contained in:
Yvan
2026-08-20 23:02:06 +08:00
parent 63dbb4cfbc
commit e65cf0b1d0
338 changed files with 622 additions and 481 deletions
-29
View File
@@ -1,29 +0,0 @@
package system
import "strings"
// IgnoredAPI describes an endpoint excluded from the generated root policy.
// It deliberately has no GORM tags so the system module can be reused by
// bootstrap and migration code without exposing data-layer PO types.
type IgnoredAPI struct {
Method string
Path string
}
func DefaultIgnoredAPIs(staticPath string) []IgnoredAPI {
staticRoute := "/" + strings.Trim(staticPath, "/") + "/*filepath"
return []IgnoredAPI{
{Method: "GET", Path: "/api/freshCasbin"},
{Method: "GET", Path: "/health"},
{Method: "GET", Path: "/swagger/*any"},
{Method: "GET", Path: staticRoute},
{Method: "HEAD", Path: staticRoute},
{Method: "POST", Path: "/system/reloadSystem"},
{Method: "POST", Path: "/base/login"},
{Method: "POST", Path: "/base/captcha"},
{Method: "POST", Path: "/init/initdb"},
{Method: "POST", Path: "/init/checkdb"},
{Method: "GET", Path: "/info/getInfoDataSource"},
{Method: "GET", Path: "/info/getInfoPublic"},
}
}