Documentation
¶
Index ¶
- Constants
- func ValidMapping(mapping string) bool
- type Attribute
- func (a *Attribute) GetConstraintDescription() string
- func (a Attribute) GetID() int64
- func (a *Attribute) GetOptionStrings() []string
- func (a Attribute) GetSortKey() int64
- func (a *Attribute) IsSelectType() bool
- func (a *Attribute) NeedsValidation() bool
- func (a *Attribute) ToExcelRow() []interface{}
- func (a Attribute) ValidateForCreate() error
- type AttributeGroup
- type AttributeGroupSortItem
- type AttributePipeline
- type AttributeSortItem
- type Builder
- func (b *Builder) AddRow(data ...interface{}) *Builder
- func (b *Builder) AddRows(rows [][]interface{}) *Builder
- func (b *Builder) Build() error
- func (b *Builder) Close() error
- func (b *Builder) ToBytes() ([]byte, error)
- func (b *Builder) With3RowHeaders(row1, row2, row3 []string) *Builder
- func (b *Builder) WithColumnWidths(widths map[int]float64) *Builder
- func (b *Builder) WithHeaders(headers ...string) *Builder
- func (b *Builder) WithStyle(style *StyleSet) *Builder
- func (b *Builder) WithValidation(colIdx int, options []string, startRow, endRow int) *Builder
- 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
- type StyleSet
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) GetConstraintDescription ¶
GetConstraintDescription 获取字段约束描述 NOTE: 用于 Excel 模板的第三行表头
func (*Attribute) GetOptionStrings ¶
GetOptionStrings 获取选项字符串列表 NOTE: 统一处理 []string、[]interface{}、primitive.A 等类型
func (*Attribute) IsSelectType ¶
IsSelectType 判断是否为选择类型字段 NOTE: select 和 list 类型需要下拉列表验证
func (*Attribute) NeedsValidation ¶
NeedsValidation 判断是否需要数据验证
func (*Attribute) ToExcelRow ¶
func (a *Attribute) ToExcelRow() []interface{}
ToExcelRow 转换为 Excel 行数据
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 Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder Excel 构建器 NOTE: 封装 excelize,提供流式、声明式的 API
func (*Builder) With3RowHeaders ¶
With3RowHeaders 设置 3 行表头 row1: 字段 UID, row2: 字段名称, row3: 字段约束
func (*Builder) WithColumnWidths ¶
WithColumnWidths 设置列宽
func (*Builder) WithHeaders ¶
WithHeaders 设置单行表头
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 = plugin.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 = plugin.ResolvedInput
type PluginResolvedResource ¶
type PluginResolvedResource = plugin.ResolvedResource
type PluginResourceAction ¶
type PluginResourceAction = plugin.ResourceAction
type PluginResourceSpec ¶
type PluginResourceSpec = plugin.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 传入对应的模型拓扑关系定义,让资源关系领域对象进行自我校验与补全