Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDependency = errors.New("存在关联数据")
Functions ¶
This section is empty.
Types ¶
type MGService ¶
type MGService interface {
// Create 创建模型分组
Create(ctx context.Context, req domain.ModelGroup) (int64, error)
// BatchCreate 批量创建模型分组
BatchCreate(ctx context.Context, req []domain.ModelGroup) ([]domain.ModelGroup, error)
// GetByNames 根据名称查询模型组
GetByNames(ctx context.Context, names []string) ([]domain.ModelGroup, error)
// GetByName 根据名称获取模型
GetByName(ctx context.Context, name string) (domain.ModelGroup, error)
// List 获取模型组列表
List(ctx context.Context, offset, limit int64) ([]domain.ModelGroup, int64, error)
// Delete 根据 ID 删除模型组
Delete(ctx context.Context, id int64) (int64, error)
// Rename 根据 ID 重命名模型组
Rename(ctx context.Context, id int64, name string) (int64, error)
}
func NewMGService ¶
func NewMGService(repo repository.MGRepository, modelRepo repository.ModelRepository) MGService
type Service ¶
type Service interface {
// Create 创建模型
Create(ctx context.Context, req domain.Model) (int64, error)
// List 获取模型列表、带有分页
List(ctx context.Context, offset, limit int64) ([]domain.Model, int64, error)
// ListAll 获取所有模型
ListAll(ctx context.Context) ([]domain.Model, error)
// GetByUids 根据唯一标识检索模型列表
GetByUids(ctx context.Context, uids []string) ([]domain.Model, error)
// GetByUid 根据唯一标识获取模型详情
GetByUid(ctx context.Context, uid string) (domain.Model, error)
// DeleteById 根据ID删除指定模型
DeleteById(ctx context.Context, id int64) (int64, error)
// DeleteByModelUid 根据唯一标识删除指定模型
DeleteByModelUid(ctx context.Context, modelUid string) (int64, error)
// FindModelById 根据ID 检索模型
FindModelById(ctx context.Context, id int64) (domain.Model, error)
// ListModelByGroupIds 获取指定组下的所有模型
ListModelByGroupIds(ctx context.Context, mgids []int64) ([]domain.Model, error)
}
func NewModelService ¶
func NewModelService(repo repository.ModelRepository) Service
Click to show internal directories.
Click to hide internal directories.