taskapi

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 9 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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