Add web product Phase 1 skeleton
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"ai-workflow-skill/internal/query"
|
||||
"ai-workflow-skill/internal/store"
|
||||
)
|
||||
|
||||
type WebService struct {
|
||||
reads *query.ReadService
|
||||
}
|
||||
|
||||
func NewWebService(db *sql.DB) *WebService {
|
||||
return &WebService{
|
||||
reads: query.NewReadService(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *WebService) ListRuns(ctx context.Context) ([]query.RunListItem, error) {
|
||||
return s.reads.ListRuns(ctx)
|
||||
}
|
||||
|
||||
func (s *WebService) GetRunDetail(ctx context.Context, runID string) (query.RunDetail, error) {
|
||||
return s.reads.GetRunDetail(ctx, runID)
|
||||
}
|
||||
|
||||
func (s *WebService) ListRunTasks(ctx context.Context, runID string) ([]store.Task, error) {
|
||||
return s.reads.ListRunTasks(ctx, runID)
|
||||
}
|
||||
|
||||
func (s *WebService) ListBlockedTasks(ctx context.Context, runID string) ([]store.BlockedTask, error) {
|
||||
return s.reads.ListBlockedTasks(ctx, runID)
|
||||
}
|
||||
|
||||
func (s *WebService) GetThreadDetail(ctx context.Context, threadID string) (store.ThreadDetail, error) {
|
||||
return s.reads.GetThreadDetail(ctx, threadID)
|
||||
}
|
||||
Reference in New Issue
Block a user