Files
kandev/apps/backend/internal/task/api/router.go
T
jcfs 20f5f43fb3 feat: complete acp-go-sdk integration with task state updates
- Use acp-go-sdk for all ACP communication in agentctl
- Mark agent as completed when Prompt() returns successfully
- Update task state to COMPLETED when agent completes
- Update task state to FAILED when agent fails and retries exhausted
- Enhanced E2E test to verify agent actually creates files
- E2E test now validates full flow: task creation -> agent work -> file creation -> task completion
2026-01-10 16:46:35 +00:00

47 lines
1.2 KiB
Go

package api
import (
"github.com/gin-gonic/gin"
"github.com/kandev/kandev/internal/common/logger"
"github.com/kandev/kandev/internal/task/service"
)
// SetupRoutes configures the task API routes
func SetupRoutes(router *gin.RouterGroup, svc *service.Service, log *logger.Logger) {
handler := NewHandler(svc, log)
// Board routes
boards := router.Group("/boards")
{
boards.POST("", handler.CreateBoard)
boards.GET("", handler.ListBoards)
boards.GET("/:boardId", handler.GetBoard)
boards.PUT("/:boardId", handler.UpdateBoard)
boards.DELETE("/:boardId", handler.DeleteBoard)
// Board sub-resources
boards.GET("/:boardId/tasks", handler.ListTasks)
boards.POST("/:boardId/columns", handler.CreateColumn)
boards.GET("/:boardId/columns", handler.ListColumns)
}
// Task routes
tasks := router.Group("/tasks")
{
tasks.POST("", handler.CreateTask)
tasks.GET("/:taskId", handler.GetTask)
tasks.PUT("/:taskId", handler.UpdateTask)
tasks.DELETE("/:taskId", handler.DeleteTask)
tasks.PUT("/:taskId/state", handler.UpdateTaskState)
tasks.PUT("/:taskId/move", handler.MoveTask)
}
// Column routes
columns := router.Group("/columns")
{
columns.GET("/:columnId", handler.GetColumn)
}
}