Documentation ¶
Index ¶
- Constants
- Variables
- func Bind(app *application.App, simple *Simple)
- func GetRulesAndFormConditionClause(dbSchema string, scope string, domainName string, ...) (clause.Clause, error)
- func HasRule(dbSchema string, scope string, domainName string, ...) (bool, error)
- func IsSupportedOperator(op string) bool
- func Lint(ruleStr string) error
- func RegisterQueryRuleDefinitionByEntity(items ...RegisterQueryRuleDefinitionsByEntityItem) error
- type AddQueryRuleJsonBody
- type EnableQueryRuleJsonBody
- type Entity
- type GetEnabledQueryRuleQueryParams
- type GetQueryRuleDefinitionQueryParams
- type GetQueryRulesQueryParams
- type Info
- type Operator
- type QueryRuleDefinitionItem
- type RegisterQueryRuleDefinitionsByEntityItem
- type RemoveQueryRuleQueryParams
- type Rule
- type Simple
Constants ¶
View Source
const ( FieldScope = "Scope" FieldDomainName = "DomainName" FieldRule = "Rule" FieldEnabled = "Enabled" )
View Source
const ( LogicalOperatorAnd = "and" LogicalOperatorOr = "or" )
Variables ¶
View Source
var ( ColumnScope = domain.ColumnName(FieldScope) ColumnDomainName = domain.ColumnName(FieldDomainName) ColumnRule = domain.ColumnName(FieldRule) ColumnEnabled = domain.ColumnName(FieldEnabled) )
Functions ¶
func Bind ¶
func Bind(app *application.App, simple *Simple)
func GetRulesAndFormConditionClause ¶ added in v1.0.5
func GetRulesAndFormConditionClause(dbSchema string, scope string, domainName string, i *infrastructure.Infrastructure, ruleParams map[string]any) (clause.Clause, error)
GetRulesAndFormConditionClause 获取规则并返回条件语句 参数: - dbSchema: 数据库schema - scope: 范围 - domainName: 领域名称 - i: 基础设施 - ruleParams: 规则参数 返回值: - 语句接口,当错误为nil时,语句接口也可能是nil,代表该规则并没有被赋值,所以是没有条件的 - 错误
func HasRule ¶
func HasRule(dbSchema string, scope string, domainName string, i *infrastructure.Infrastructure) (bool, error)
func IsSupportedOperator ¶
func RegisterQueryRuleDefinitionByEntity ¶
func RegisterQueryRuleDefinitionByEntity(items ...RegisterQueryRuleDefinitionsByEntityItem) error
Types ¶
type AddQueryRuleJsonBody ¶
type EnableQueryRuleJsonBody ¶ added in v1.0.7
type EnableQueryRuleJsonBody struct {
request.IDJsonBody
}
type Entity ¶ added in v1.0.7
type Entity struct { entity.Base Scope string `sqlmapping:"column:scope;key;notUpdate;" sqlresult:"column:scope;" check:"required,lte=256"` DomainName string `sqlmapping:"column:domain_name;notUpdate;" sqlresult:"column:domain_name;" check:"required,lte=256"` Rule string `sqlmapping:"column:rule;notUpdate;" sqlresult:"column:rule;" check:"required"` Enabled bool `sqlresult:"column:enabled;" sqlresult:"column:enabled;"` }
func (*Entity) DomainCNName ¶ added in v1.0.7
func (*Entity) DomainCamelName ¶ added in v1.0.7
type GetEnabledQueryRuleQueryParams ¶ added in v1.0.7
type GetQueryRuleDefinitionQueryParams ¶
type GetQueryRuleDefinitionQueryParams struct {
DomainName string `form:"domainName" binding:"required" assign:"toField:DomainName"`
}
type GetQueryRulesQueryParams ¶ added in v1.0.7
type Info ¶
type Info struct { application.InfoIDField Scope string `json:"scope" sqlresult:"column:scope"` DomainName string `json:"domainName" sqlresult:"column:domain_name"` Rule string `json:"rule" sqlresult:"column:rule"` }
type QueryRuleDefinitionItem ¶
type QueryRuleDefinitionItem struct { FieldType string `json:"fieldType"` FieldName string `json:"fieldName"` FieldCNName string `json:"fieldCNName"` ColumnName string `json:"columnName"` Operators []Operator `json:"operators"` }
func GetQueryRuleDefinition ¶
func GetQueryRuleDefinition(domainName string) []QueryRuleDefinitionItem
type RemoveQueryRuleQueryParams ¶ added in v1.0.7
type RemoveQueryRuleQueryParams struct {
request.IDQueryParam
}
type Rule ¶
Click to show internal directories.
Click to hide internal directories.