Documentation
¶
Overview ¶
Package taskapi hosts the business/HTTP-facing task read-model queries (pagination, list, detail) that return presentation dto types.
These are intentionally kept OUT of the core repository/query package so that the engine core (engine/runtime/worker → repository/query) carries no dependency on flux-workflow/dto. Only the HTTP layer (handler/server) imports this package.
Index ¶
- type Repository
- func (r *Repository) GetTaskDetail(ctx context.Context, taskID int64) (*dto.TaskDetail, error)
- func (r *Repository) ListByUser(ctx context.Context, userID int64, params dto.PageRequest) ([]*domain.Task, int64, error)
- func (r *Repository) ListByUserV2(ctx context.Context, userID int64, req dto.TaskListReq) ([]*dto.Task, int64, error)
- type TaskQueryRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
repository.TaskRepository
// contains filtered or unexported fields
}
Repository wraps a core repository.TaskRepository with the dto-returning read-model queries, sharing the same *gorm.DB.
func New ¶
func New(db *gorm.DB, core repository.TaskRepository) *Repository
New builds a TaskQueryRepository over the given DB and core task repository.
func (*Repository) GetTaskDetail ¶
func (r *Repository) GetTaskDetail(ctx context.Context, taskID int64) (*dto.TaskDetail, error)
func (*Repository) ListByUser ¶
func (r *Repository) ListByUser( ctx context.Context, userID int64, params dto.PageRequest, ) ([]*domain.Task, int64, error)
func (*Repository) ListByUserV2 ¶
func (r *Repository) ListByUserV2( ctx context.Context, userID int64, req dto.TaskListReq, ) ([]*dto.Task, int64, error)
type TaskQueryRepository ¶
type TaskQueryRepository interface {
repository.TaskRepository
// ListByUser 分页列出某用户的根任务。
ListByUser(ctx context.Context, userID int64, params dto.PageRequest) ([]*domain.Task, int64, error)
// ListByUserV2 轻量列表查询。
ListByUserV2(ctx context.Context, userID int64, req dto.TaskListReq) ([]*dto.Task, int64, error)
// GetTaskDetail 取任务详情(含物化的 final 结果)。
GetTaskDetail(ctx context.Context, taskID int64) (*dto.TaskDetail, error)
}
TaskQueryRepository extends the core repository.TaskRepository with business-facing read-model queries returning presentation dto types.