Documentation ¶
Index ¶
- Constants
- Variables
- func Bind(app *application.App, simple *Simple)
- func FormConditions(rules []Rule) (*sql.Conditions, error)
- func GetRulesAndFormConditions(dbSchema string, scope string, domainName string, ...) (*sql.Conditions, 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 GetQueryRuleDefinitionQueryParams
- type GetQueryRuleQueryParams
- type Info
- type Operator
- type QueryRuleDefinitionItem
- type RegisterQueryRuleDefinitionsByEntityItem
- type RemoveQueryRuleJsonBody
- type Rule
- type Simple
- type ValueObject
Constants ¶
View Source
const ( FieldScope = "Scope" FieldDomainName = "DomainName" FieldRule = "Rule" )
Variables ¶
View Source
var ( ColumnScope = domain.ColumnName(FieldScope) ColumnDomainName = "domain_name" ColumnRule = domain.ColumnName(FieldRule) )
Functions ¶
func Bind ¶
func Bind(app *application.App, simple *Simple)
func FormConditions ¶
func FormConditions(rules []Rule) (*sql.Conditions, error)
func GetRulesAndFormConditions ¶
func GetRulesAndFormConditions(dbSchema string, scope string, domainName string, i *infrastructure.Infrastructure) (*sql.Conditions, error)
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 GetQueryRuleDefinitionQueryParams ¶
type GetQueryRuleDefinitionQueryParams struct {
DomainName string `form:"domainName" binding:"required" assign:"toField:RuleDomainName"`
}
type GetQueryRuleQueryParams ¶
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 RemoveQueryRuleJsonBody ¶
type Rule ¶
type Rule struct { FieldName string `json:"fieldName"` FieldType string `json:"fieldType"` ColumnName string `json:"columnName"` Operator string `json:"operator"` Value any `json:"value"` }
func GetRules ¶
func GetRules(dbSchema string, scope string, domainName string, i *infrastructure.Infrastructure) ([]Rule, error)
type ValueObject ¶
type ValueObject struct { value_object.Base Scope string `sqlmapping:"column:scope;key;notUpdate;" sqlresult:"column:scope;" check:"required,lte=256"` RuleDomainName string `sqlmapping:"column:domain_name;key;notUpdate;" sqlresult:"column:domain_name;" check:"required,lte=256"` Rule string `sqlmapping:"column:rule;notUpdate;" sqlresult:"column:rule;" check:"required"` }
func (*ValueObject) CheckKeyFields ¶
func (valueObject *ValueObject) CheckKeyFields() error
func (*ValueObject) DomainCNName ¶
func (valueObject *ValueObject) DomainCNName() string
func (*ValueObject) DomainCamelName ¶
func (valueObject *ValueObject) DomainCamelName() string
func (*ValueObject) ForCreate ¶
func (valueObject *ValueObject) ForCreate() error
Click to show internal directories.
Click to hide internal directories.