| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package rule
- import (
- "git.sxidc.com/go-framework/baize/framework/core/domain"
- "git.sxidc.com/go-framework/baize/framework/core/domain/entity"
- )
- const (
- FieldScope = "Scope"
- FieldDomainName = "DomainName"
- FieldRule = "Rule"
- FieldEnabled = "Enabled"
- )
- var (
- ColumnScope = domain.ColumnName(FieldScope)
- ColumnDomainName = domain.ColumnName(FieldDomainName)
- ColumnRule = domain.ColumnName(FieldRule)
- ColumnEnabled = domain.ColumnName(FieldEnabled)
- )
- var fieldMap = map[string]string{
- FieldScope: "范围",
- FieldDomainName: "领域名",
- FieldRule: "规则",
- }
- type Entity struct {
- entity.Base
- Scope string `sqlmapping:"column:scope;notUpdate;" sqlresult:"column:scope;" check:"required,lte=256,when=create"`
- DomainName string `sqlmapping:"column:domain_name;notUpdate;" sqlresult:"column:domain_name;" check:"required,lte=256,when=create"`
- Rule string `sqlmapping:"column:rule;notUpdate;" sqlresult:"column:rule;" check:"required,when=create"`
- Enabled bool `sqlresult:"column:enabled;" sqlresult:"column:enabled;"`
- }
- func (e *Entity) DomainCNName() string {
- return "查询规则"
- }
- func (e *Entity) DomainCamelName() string {
- return "QueryRule"
- }
- func (e *Entity) GetFieldMap() map[string]string {
- return fieldMap
- }
|