package system

// CasbinInfo Casbin信息结构
type CasbinInfo struct {
	Path   string `json:"path"`   // 路径
	Method string `json:"method"` // 方法
}

// UpdateCasbinRequest 更新Casbin请求
type UpdateCasbinRequest struct {
	AuthorityId uint         `json:"authorityId"` // 权限id
	CasbinInfos []CasbinInfo `json:"casbinInfos"`
}

// GetPolicyPathByAuthorityIdRequest 根据权限ID获取策略路径请求
type GetPolicyPathByAuthorityIdRequest struct {
	AuthorityId uint `json:"authorityId" form:"authorityId"`
}

// PolicyPathResponse 策略路径响应
type PolicyPathResponse struct {
	Paths []CasbinInfo `json:"paths"`
}

// DefaultCasbin 默认Casbin规则
func DefaultCasbin() []CasbinInfo {
	return []CasbinInfo{
		{Path: "/menu/getMenu", Method: "POST"},
		{Path: "/jwt/jsonInBlacklist", Method: "POST"},
		{Path: "/base/login", Method: "POST"},
		{Path: "/user/changePassword", Method: "POST"},
		{Path: "/user/setUserAuthority", Method: "POST"},
		{Path: "/user/getUserInfo", Method: "GET"},
		{Path: "/user/setSelfInfo", Method: "PUT"},
		{Path: "/fileUploadAndDownload/upload", Method: "POST"},
		{Path: "/sysDictionary/findSysDictionary", Method: "GET"},
	}
}
