Documentation
¶
Index ¶
- Constants
- func ValidMapping(mapping string) bool
- type Attribute
- type AttributeGroup
- type AttributeGroupSortItem
- type AttributePipeline
- type AttributeSortItem
- type Condition
- type EnumOption
- type FieldDelete
- type FieldSecureAttrChange
- type FilterCondition
- type FilterGroup
- type Model
- type ModelDiagram
- type ModelGroup
- type ModelRelation
- type Operator
- type Plugin
- type PluginActionSpec
- type PluginBinding
- type PluginBindingDetail
- type PluginBoundModel
- type PluginDetail
- type PluginFilter
- type PluginListItem
- type PluginManagementEnums
- type PluginModelVM
- type PluginResolvedInput
- type PluginResolvedResource
- type PluginResourceAction
- type PluginResourceSpec
- type RelationType
- type Resource
- type ResourceAggregatedAssets
- type ResourceDiagram
- type ResourceRelation
- type SavePluginBindings
- type SearchResource
Constants ¶
const ( MappingOneToOne = "one_to_one" // 一对一关系 MappingOneToMany = "one_to_many" // 一对多关系 MappingManyToMany = "many_to_many" // 多对多关系 )
Variables ¶
This section is empty.
Functions ¶
func ValidMapping ¶
Types ¶
type Attribute ¶
type Attribute struct {
ID int64
GroupId int64
ModelUid string
FieldUid string
FieldName string
FieldType string
Required bool
Display bool
Secure bool
Link bool
Index int64
SortKey int64 // 拖拽排序键(稀疏索引)
Option interface{}
Version int64
Builtin bool
}
func (*Attribute) GetOptionStrings ¶
GetOptionStrings 获取选项字符串列表 NOTE: 仅当字段为 select 或 list 时才解析选项,统一处理 []string、[]interface{}、primitive.A 等类型
func (Attribute) ValidateForCreate ¶
type AttributeGroup ¶
func (AttributeGroup) GetSortKey ¶
func (ag AttributeGroup) GetSortKey() int64
GetSortKey 实现 Sortable 接口
type AttributeGroupSortItem ¶
AttributeGroupSortItem 属性组排序更新项 NOTE: 用于批量更新时的数据传输
type AttributePipeline ¶
type AttributeSortItem ¶
AttributeSortItem 属性排序更新项 NOTE: 用于批量更新时的数据传输
type EnumOption ¶
type FieldDelete ¶
type FieldSecureAttrChange ¶
type FilterCondition ¶
type FilterCondition struct {
FieldUID string `json:"field_uid"`
Operator Operator `json:"operator"`
Value interface{} `json:"value"`
}
FilterCondition 筛选条件
type FilterGroup ¶
type FilterGroup struct {
Filters []FilterCondition `json:"filters"`
}
FilterGroup 筛选条件组 (组内 AND)
type Model ¶
type Model struct {
ID int64
GroupId int64
Name string
UID string
Icon string
Builtin bool
Ctime time.Time
Utime time.Time
}
func (*Model) EnsureDeletable ¶
EnsureDeletable 校验模型是否允许删除 NOTE: 内置模型禁止删除,将此业务规则内聚到领域对象
type ModelDiagram ¶
type ModelDiagram struct {
ID int64
RelationTypeUid string
TargetModelUid string
SourceModelUid string
}
ModelDiagram 拓补图模型关联节点信息
type ModelGroup ¶
type ModelRelation ¶
type ModelRelation struct {
ID int64
SourceModelUID string
TargetModelUID string
RelationTypeUID string // 关联类型唯一索引
RelationName string // 拼接字符
Mapping string // 关联关系
Ctime time.Time
Utime time.Time
}
func (*ModelRelation) BelongsTo ¶
func (m *ModelRelation) BelongsTo(modelUid string) bool
BelongsTo 判定指定的 modelUid 是否参与了该关系定义
func (*ModelRelation) IsSource ¶
func (m *ModelRelation) IsSource(modelUid string) bool
IsSource 判定指定的 modelUid 是否为该关系定义的源端
func (*ModelRelation) IsTarget ¶
func (m *ModelRelation) IsTarget(modelUid string) bool
IsTarget 判定指定的 modelUid 是否为该关系定义的目标端
func (*ModelRelation) RM ¶
func (m *ModelRelation) RM() string
func (*ModelRelation) Validate ¶
func (m *ModelRelation) Validate() error
Validate 校验模型关联定义本身的合法性并自我补齐关联名
type PluginActionSpec ¶
type PluginActionSpec = types.ActionSpec
type PluginBinding ¶
type PluginBindingDetail ¶
type PluginBindingDetail struct {
ID int64 `json:"id"`
UID string `json:"uid"`
PluginID string `json:"plugin_id"`
ModelUID string `json:"model_uid"`
ModelName string `json:"model_name,omitempty"`
GroupName string `json:"group_name,omitempty"`
ModelIcon string `json:"model_icon,omitempty"`
Enabled bool `json:"enabled"`
Graph *pluginx.BindingGraph `json:"graph,omitempty"`
}
type PluginBoundModel ¶
type PluginDetail ¶
type PluginDetail struct {
Plugin pluginx.Plugin `json:"plugin"`
Bindings []PluginBindingDetail `json:"bindings"`
}
type PluginFilter ¶
type PluginListItem ¶
type PluginListItem struct {
ID int64 `json:"id"`
UID string `json:"uid"`
Name string `json:"name"`
Type string `json:"type"`
Version string `json:"version"`
ActionCount int `json:"action_count"`
BindingCount int `json:"binding_count"`
BoundModels []PluginBoundModel `json:"bound_models"`
Actions []pluginx.ActionSpec `json:"actions"`
UpdatedAt int64 `json:"updated_at"`
}
type PluginManagementEnums ¶
type PluginManagementEnums struct {
Types []string `json:"types"`
Placements []EnumOption `json:"placements"`
Directions []EnumOption `json:"directions"`
RelationTypes []EnumOption `json:"relation_types"`
Cardinalities []EnumOption `json:"cardinalities"`
Mappings []EnumOption `json:"mappings"`
Models []PluginModelVM `json:"models"`
}
type PluginModelVM ¶
type PluginResolvedInput ¶
type PluginResolvedInput = types.ResolvedInput
type PluginResolvedResource ¶
type PluginResolvedResource = types.ResolvedResource
type PluginResourceAction ¶
type PluginResourceAction = types.ResourceAction
type PluginResourceSpec ¶
type PluginResourceSpec = types.ResourceSpec
type RelationType ¶
type ResourceDiagram ¶
type ResourceDiagram struct {
SRC []ResourceRelation
DST []ResourceRelation
}
type ResourceRelation ¶
type ResourceRelation struct {
ID int64
SourceModelUID string
TargetModelUID string
SourceResourceID int64
TargetResourceID int64
RelationTypeUID string // 关联类型唯一索引
RelationName string // 拼接字符
}
func (*ResourceRelation) ValidateAndComplete ¶
func (r *ResourceRelation) ValidateAndComplete(mr ModelRelation) error
ValidateAndComplete 传入对应的模型拓扑关系定义,让资源关系领域对象进行自我校验与补全