优化结构

This commit is contained in:
Yvan
2026-08-21 10:29:14 +08:00
parent 56980c8087
commit 055f6811ca
340 changed files with 382 additions and 382 deletions
+29
View File
@@ -0,0 +1,29 @@
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"},
}
}