Files
backend/internal/config/casbin.go
lan ae5b997924 feat(auth): add Casbin RBAC and user activity tracking
Integrate Casbin for role-based access control with admin routes for role management. Add user activity logging service to track login and refresh events. Refactor audit service to use AI-based content moderation.
2026-03-14 02:09:38 +08:00

23 lines
612 B
Go

package config
// CasbinConfig Casbin 配置
type CasbinConfig struct {
// ModelPath Casbin 模型文件路径
ModelPath string `mapstructure:"model_path"`
// AutoSave 是否自动保存策略到数据库
AutoSave bool `mapstructure:"auto_save"`
// AutoLoad 是否自动从数据库加载策略
AutoLoad bool `mapstructure:"auto_load"`
// EnableCache 是否启用 Redis 缓存
EnableCache bool `mapstructure:"enable_cache"`
// CacheTTL 缓存过期时间 (秒)
CacheTTL int `mapstructure:"cache_ttl"`
// SkipRoutes 跳过权限检查的路由
SkipRoutes []string `mapstructure:"skip_routes"`
}