Documentation
¶
Index ¶
Constants ¶
View Source
const (
// IndexGap 稀疏索引间隔
IndexGap = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldSecureAttrChangeEventProducer ¶
type FieldSecureAttrChangeEventProducer interface {
Produce(ctx context.Context, evt domain.FieldSecureAttrChange) error
}
type IFieldDeleteEventProducer ¶
type IFieldDeleteEventProducer interface {
Produce(ctx context.Context, evt domain.FieldDelete) error
}
type Service ¶
type Service interface {
// CreateAttribute 创建模型字段
CreateAttribute(ctx context.Context, req domain.Attribute) (int64, error)
// BatchCreateAttribute 批量创建模型字段
BatchCreateAttribute(ctx context.Context, attrs []domain.Attribute) error
// SearchAttributeFieldsByModelUid 查询模型下的所有字段信息,不包含安全字段,内部使用
SearchAttributeFieldsByModelUid(ctx context.Context, modelUid string) ([]string, error)
// SearchAllAttributeFieldsByModelUid 查询模型下的所有字段信息,内部使用
SearchAllAttributeFieldsByModelUid(ctx context.Context, modelUid string) ([]string, error)
// SearchAttributeFieldsBySecure 查询全有的安全字段
SearchAttributeFieldsBySecure(ctx context.Context, modelUids []string) (map[string][]string, error)
// ListAttributes 查询模型下的所有字段详情信息,前端使用
ListAttributes(ctx context.Context, modelUID string) ([]domain.Attribute, int64, error)
// DeleteAttribute 删除模型字段
DeleteAttribute(ctx context.Context, id int64) (int64, error)
// UpdateAttribute 更新模型字段
UpdateAttribute(ctx context.Context, attribute domain.Attribute) (int64, error)
// CustomAttributeFieldColumns 自定义展示字段、以及排序
CustomAttributeFieldColumns(ctx context.Context, modelUid string, customField []string) (int64, error)
// ListAttributePipeline 根据组聚合获取每个组下的所有字段
ListAttributePipeline(ctx context.Context, modelUid string) ([]domain.AttributePipeline, error)
// CreateDefaultAttribute 创建新模型,创建默认字段信息
CreateDefaultAttribute(ctx context.Context, modelUid string) (int64, error)
// CreateAttributeGroup 创建模型字段组
CreateAttributeGroup(ctx context.Context, req domain.AttributeGroup) (int64, error)
// ListAttributeGroup 模型组
ListAttributeGroup(ctx context.Context, modelUid string) ([]domain.AttributeGroup, error)
// ListAttributeGroupByIds 返回每个组下面的属性
ListAttributeGroupByIds(ctx context.Context, ids []int64) ([]domain.AttributeGroup, error)
// BatchCreateAttributeGroup 批量创建组
BatchCreateAttributeGroup(ctx context.Context, ags []domain.AttributeGroup) ([]domain.AttributeGroup, error)
// DeleteAttributeGroup 删除模型字段组
DeleteAttributeGroup(ctx context.Context, id int64) (int64, error)
// RenameAttributeGroup 重命名属性组
RenameAttributeGroup(ctx context.Context, id int64, name string) (int64, error)
// Sort 属性拖拽排序
Sort(ctx context.Context, id, targetGroupId, targetPosition int64) error
// SortAttributeGroup 属性组拖拽排序
SortAttributeGroup(ctx context.Context, id, targetPosition int64) error
}
func NewService ¶
func NewService(repo repository.AttributeRepository, groupRepo repository.AttributeGroupRepository, producer FieldSecureAttrChangeEventProducer, deleteProducer IFieldDeleteEventProducer) Service
Click to show internal directories.
Click to hide internal directories.