Documentation
¶
Index ¶
- Variables
- func Load()
- func UploadExcel(filename string) error
- type AttributeSpecs
- type MetaDefinition
- func (md *MetaDefinition) GetAttributeSpecEntity(specId uint64, effectiveDate *time.Time) *entity.AttributeSpec
- func (md *MetaDefinition) GetChildrenAttributeSpec(specId uint64, effectiveDate *time.Time, dynamic bool) []*entity.AttributeSpec
- func (md *MetaDefinition) GetConnection(specType string, parentId uint64, subId uint64, effectiveDate *time.Time) *entity.ConnectionSpec
- func (md *MetaDefinition) GetFixedAttributes(fixedSpecId uint64) map[string]string
- func (md *MetaDefinition) GetFixedAttributesAlias(fixedSpecId uint64, attributeSpec *entity.AttributeSpec) string
- func (md *MetaDefinition) GetFixedRoleSpec(fixedSpecId uint64) *entity.FixedRoleSpec
- func (md *MetaDefinition) GetRoleSpec(specId uint64, effectiveDate *time.Time) (*RoleSpec, *ModelSpec)
- type ModelSpec
- type RoleSpec
- func (this *RoleSpec) GetChildActionSpec(kind string) *entity.ActionSpec
- func (this *RoleSpec) GetChildAttributeSpec(kind string) *entity.AttributeSpec
- func (this *RoleSpec) GetChildConnectionSpec(subSpecId uint64) *entity.ConnectionSpec
- func (this *RoleSpec) GetChildRoleSpec(kind string) *RoleSpec
- func (this *RoleSpec) GetFixedService() baseservice.BaseService
- func (this *RoleSpec) GetRoleSpecMap() map[uint64]*RoleSpec
- func (this *RoleSpec) GetSortedAttributeSpecs(dynamic bool) []*entity.AttributeSpec
- func (this *RoleSpec) GetSortedRoleSpecs() []*RoleSpec
- type RoleSpecs
Constants ¶
This section is empty.
Variables ¶
View Source
var MemCache = cache.NewMemCache("spec", 1000, 1000)
Functions ¶
func UploadExcel ¶
Types ¶
type AttributeSpecs ¶
type AttributeSpecs []*entity.AttributeSpec
func (AttributeSpecs) Len ¶
func (as AttributeSpecs) Len() int
func (AttributeSpecs) Less ¶
func (as AttributeSpecs) Less(i, j int) bool
func (AttributeSpecs) Swap ¶
func (as AttributeSpecs) Swap(i, j int)
type MetaDefinition ¶
type MetaDefinition struct { RoleSpecs []*entity.RoleSpec `json:",omitempty"` AttributeSpecs []*entity.AttributeSpec `json:",omitempty"` ActionSpecs []*entity.ActionSpec `json:",omitempty"` FixedRoleSpecs []*entity.FixedRoleSpec `json:",omitempty"` ConnectionSpecs []*entity.ConnectionSpec `json:",omitempty"` }
func GetMetaDefinition ¶
func GetMetaDefinition() *MetaDefinition
func (*MetaDefinition) GetAttributeSpecEntity ¶
func (md *MetaDefinition) GetAttributeSpecEntity(specId uint64, effectiveDate *time.Time) *entity.AttributeSpec
func (*MetaDefinition) GetChildrenAttributeSpec ¶
func (md *MetaDefinition) GetChildrenAttributeSpec(specId uint64, effectiveDate *time.Time, dynamic bool) []*entity.AttributeSpec
* 返回动态属性或者静态属性
func (*MetaDefinition) GetConnection ¶
func (md *MetaDefinition) GetConnection(specType string, parentId uint64, subId uint64, effectiveDate *time.Time) *entity.ConnectionSpec
func (*MetaDefinition) GetFixedAttributes ¶
func (md *MetaDefinition) GetFixedAttributes(fixedSpecId uint64) map[string]string
返回缓存的字段名map,可用于判断字段是否存在
func (*MetaDefinition) GetFixedAttributesAlias ¶
func (md *MetaDefinition) GetFixedAttributesAlias(fixedSpecId uint64, attributeSpec *entity.AttributeSpec) string
如果返回的alias不为空,说明这是静态属性,字段名就是返回的别名
func (*MetaDefinition) GetFixedRoleSpec ¶
func (md *MetaDefinition) GetFixedRoleSpec(fixedSpecId uint64) *entity.FixedRoleSpec
func (*MetaDefinition) GetRoleSpec ¶
type ModelSpec ¶
type ModelSpec struct { entity.RoleSpec Children []*ModelSpec `json:"children,omitempty"` AttributeSpecs []*entity.AttributeSpec `json:",omitempty"` ActionSpecs []*entity.ActionSpec `json:",omitempty"` FixedRoleSpec *entity.FixedRoleSpec `json:",omitempty"` ConnectionSpecs map[string][]*entity.ConnectionSpec `json:",omitempty"` EffectiveDate *time.Time }
* 这个角色定义专用于与前端的交互
type RoleSpec ¶
type RoleSpec struct { entity.RoleSpec RoleSpecs map[uint64]*RoleSpec `json:",omitempty"` AttributeSpecs map[uint64]*entity.AttributeSpec `json:",omitempty"` ActionSpecs map[uint64]*entity.ActionSpec `json:",omitempty"` FixedRoleSpec *entity.FixedRoleSpec `json:",omitempty"` FixedAttributes map[string]string `json:"-,omitempty"` ConnectionSpecs map[string]*entity.ConnectionSpec `json:",omitempty"` EffectiveDate *time.Time Parent *RoleSpec `json:"-,omitempty"` Path string `json:"-,omitempty"` }
func (*RoleSpec) GetChildActionSpec ¶
func (this *RoleSpec) GetChildActionSpec(kind string) *entity.ActionSpec
func (*RoleSpec) GetChildAttributeSpec ¶
func (this *RoleSpec) GetChildAttributeSpec(kind string) *entity.AttributeSpec
func (*RoleSpec) GetChildConnectionSpec ¶
func (this *RoleSpec) GetChildConnectionSpec(subSpecId uint64) *entity.ConnectionSpec
func (*RoleSpec) GetChildRoleSpec ¶
func (*RoleSpec) GetFixedService ¶
func (this *RoleSpec) GetFixedService() baseservice.BaseService
func (*RoleSpec) GetRoleSpecMap ¶
func (*RoleSpec) GetSortedAttributeSpecs ¶
func (this *RoleSpec) GetSortedAttributeSpecs(dynamic bool) []*entity.AttributeSpec
func (*RoleSpec) GetSortedRoleSpecs ¶
Click to show internal directories.
Click to hide internal directories.