domain

package
v1.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MappingOneToOne   = "one_to_one"   // 一对一关系
	MappingOneToMany  = "one_to_many"  // 一对多关系
	MappingManyToMany = "many_to_many" // 多对多关系
)

Variables

This section is empty.

Functions

func ValidMapping

func ValidMapping(mapping string) bool

Types

type AdminSearchModelCount added in v1.11.4

type AdminSearchModelCount struct {
	TenantID int64
	ModelUID string
	Total    int
}

AdminSearchModelCount DAO 聚合纯计数结果

type AdminSearchStructureModel added in v1.11.4

type AdminSearchStructureModel struct {
	ModelUID  string `json:"model_uid"`
	ModelName string `json:"model_name"`
	Total     int    `json:"total"`
}

AdminSearchStructureModel 大盘模型维度统计

type AdminSearchStructureResult added in v1.11.4

type AdminSearchStructureResult struct {
	Total         int                          `json:"total"`
	Organizations []AdminSearchStructureTenant `json:"organizations"`
	Personals     []AdminSearchStructureTenant `json:"personals"`
}

AdminSearchStructureResult 全局大盘结构与导航响应

func (AdminSearchStructureResult) ModelUIDs added in v1.11.4

func (r AdminSearchStructureResult) ModelUIDs() []string

ModelUIDs 提取跨租户大盘中所有命中的唯一模型标识

type AdminSearchStructureTenant added in v1.11.4

type AdminSearchStructureTenant struct {
	TenantID   int64                       `json:"tenant_id"`
	TenantType string                      `json:"tenant_type"`
	Total      int                         `json:"total"`
	Models     []AdminSearchStructureModel `json:"models"`
}

AdminSearchStructureTenant 大盘租户维度统计与模型 Tabs

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 ResolveDisplayFields added in v1.11.4

func ResolveDisplayFields(attrs []Attribute) []Attribute

ResolveDisplayFields 解析模型的默认展示列 策略 1:如果存在显式配置为 Display == true 的属性,按 Index 升序排列返回 策略 2:若未显式配置,进行智能兜底:按 SortKey、Index 升序排列,排除文件与内置字段,返回前 6 个核心属性

func (Attribute) GetID

func (a Attribute) GetID() int64

GetID 实现 Sortable 接口

func (*Attribute) GetOptionStrings

func (a *Attribute) GetOptionStrings() []string

GetOptionStrings 获取选项字符串列表 NOTE: 仅当字段为 select 或 list 时才解析选项,统一处理 []string、[]interface{}、primitive.A 等类型

func (Attribute) GetSortKey

func (a Attribute) GetSortKey() int64

GetSortKey 实现 Sortable 接口

func (Attribute) ValidateForCreate

func (a Attribute) ValidateForCreate() error

type AttributeGroup

type AttributeGroup struct {
	ID       int64
	Name     string
	ModelUid string
	SortKey  int64
}

func (AttributeGroup) GetID

func (ag AttributeGroup) GetID() int64

GetID 实现 Sortable 接口

func (AttributeGroup) GetSortKey

func (ag AttributeGroup) GetSortKey() int64

GetSortKey 实现 Sortable 接口

type AttributeGroupSortItem

type AttributeGroupSortItem struct {
	ID      int64
	SortKey int64
}

AttributeGroupSortItem 属性组排序更新项 NOTE: 用于批量更新时的数据传输

type AttributePipeline

type AttributePipeline struct {
	GroupId    int64       `bson:"_id"`
	Total      int         `bson:"total"`
	Attributes []Attribute `bson:"attributes"`
}

type AttributeSortItem

type AttributeSortItem struct {
	ID      int64
	GroupId int64
	SortKey int64
}

AttributeSortItem 属性排序更新项 NOTE: 用于批量更新时的数据传输

type Condition

type Condition struct {
	Name      string `json:"name"`      // 过滤名称
	Condition string `json:"condition"` // 过滤条件
	Input     string `json:"input"`     // 过滤输入
}

type EnumOption

type EnumOption struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type FieldDelete

type FieldDelete struct {
	ModelUid    string `json:"model_uid"`    // 模型唯一标识
	FieldUid    string `json:"field_uid"`    // 字段唯一标识
	TriggerTime int64  `json:"trigger_time"` // 触发时间
}

type FieldSecureAttrChange

type FieldSecureAttrChange struct {
	ModelUid   string `json:"model_uid"` // 模型唯一标识
	FieldUid   string `json:"field_uid"` // 模型字段唯一标识
	Secure     bool   `json:"secure"`    // 安全字段修改状态
	TiggerTime int64  `json:"ctime"`     // 触发时间
}

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

func (m *Model) EnsureDeletable() error

EnsureDeletable 校验模型是否允许删除 NOTE: 内置模型禁止删除,将此业务规则内聚到领域对象

func (*Model) SheetName

func (m *Model) SheetName() string

type ModelDiagram

type ModelDiagram struct {
	ID              int64
	RelationTypeUid string
	TargetModelUid  string
	SourceModelUid  string
}

ModelDiagram 拓补图模型关联节点信息

type ModelGroup

type ModelGroup struct {
	ID   int64
	Name string
}

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 Operator

type Operator string

Operator 导出操作符枚举

const (
	OperatorEq       Operator = "eq"
	OperatorNe       Operator = "ne"
	OperatorContains Operator = "contains"
	OperatorGt       Operator = "gt"
	OperatorLt       Operator = "lt"
)

type Plugin

type Plugin = types.Plugin

type PluginActionSpec

type PluginActionSpec = types.ActionSpec

type PluginBinding

type PluginBinding = types.Binding

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 PluginBoundModel struct {
	UID       string `json:"uid"`
	Name      string `json:"name"`
	GroupName string `json:"group_name,omitempty"`
	Icon      string `json:"icon,omitempty"`
	Builtin   bool   `json:"builtin"`
}

type PluginDetail

type PluginDetail struct {
	Plugin   pluginx.Plugin        `json:"plugin"`
	Bindings []PluginBindingDetail `json:"bindings"`
}

type PluginFilter

type PluginFilter = types.Filter

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 PluginModelVM struct {
	UID       string `json:"uid"`
	Name      string `json:"name"`
	GroupName string `json:"group_name,omitempty"`
	Icon      string `json:"icon,omitempty"`
	Builtin   bool   `json:"builtin"`
}

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 RelationType struct {
	ID             int64
	Name           string
	UID            string
	SourceDescribe string
	TargetDescribe string
	Ctime          time.Time
	Utime          time.Time
}

func (*RelationType) Validate

func (r *RelationType) Validate() error

Validate 校验关联类型定义合法性

type Resource

type Resource struct {
	ID       int64         `json:"id"`
	Name     string        `json:"name"`
	ModelUID string        `json:"model_uid"`
	Data     mongox.MapStr `json:"data"`
}

type ResourceAggregatedAssets

type ResourceAggregatedAssets struct {
	RelationName string
	ModelUid     string
	Total        int
	ResourceIds  []int64
}

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 传入对应的模型拓扑关系定义,让资源关系领域对象进行自我校验与补全

type SavePluginBindings

type SavePluginBindings struct {
	PluginID string
	Bindings []pluginx.Binding
}

type SearchStructureResult added in v1.11.4

type SearchStructureResult struct {
	Total  int                         `json:"total"`
	Models []AdminSearchStructureModel `json:"models"`
}

SearchStructureResult 单租户检索模型 Tabs 概览

func (SearchStructureResult) ModelUIDs added in v1.11.4

func (r SearchStructureResult) ModelUIDs() []string

ModelUIDs 提取单租户检索命中所有模型的唯一标识

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL