You've already forked agentic-coding-workflow
修复启动问题
This commit is contained in:
@@ -42,35 +42,34 @@ func NewHandler(ws WorkspaceService, wt WorktreeService, gop GitOpsService, reso
|
||||
|
||||
// Mount 把所有 workspace / worktree / gitops 路由挂到 r 上,统一装入 Auth 中间件。
|
||||
func (h *Handler) Mount(r chi.Router) {
|
||||
r.Route("/api/v1", func(r chi.Router) {
|
||||
r.Use(middleware.Auth(h.resolver, middleware.AuthOptions{}))
|
||||
r.Route("/projects/{projectSlug}/workspaces", func(r chi.Router) {
|
||||
r.Post("/", h.createWorkspace)
|
||||
r.Get("/", h.listWorkspaces)
|
||||
})
|
||||
r.Route("/workspaces/{wsID}", func(r chi.Router) {
|
||||
r.Get("/", h.getWorkspace)
|
||||
r.Patch("/", h.updateWorkspace)
|
||||
r.Delete("/", h.deleteWorkspace)
|
||||
r.Post("/sync", h.syncWorkspace)
|
||||
r.Put("/credential", h.upsertCredential)
|
||||
r.Get("/credential", h.getCredentialMeta)
|
||||
auth := middleware.Auth(h.resolver, middleware.AuthOptions{})
|
||||
|
||||
r.Get("/main/status", h.statusOnMain)
|
||||
r.Post("/main/commit", h.commitOnMain)
|
||||
r.Post("/main/push", h.pushOnMain)
|
||||
r.With(auth).Route("/api/v1/projects/{projectSlug}/workspaces", func(r chi.Router) {
|
||||
r.Post("/", h.createWorkspace)
|
||||
r.Get("/", h.listWorkspaces)
|
||||
})
|
||||
r.With(auth).Route("/api/v1/workspaces/{wsID}", func(r chi.Router) {
|
||||
r.Get("/", h.getWorkspace)
|
||||
r.Patch("/", h.updateWorkspace)
|
||||
r.Delete("/", h.deleteWorkspace)
|
||||
r.Post("/sync", h.syncWorkspace)
|
||||
r.Put("/credential", h.upsertCredential)
|
||||
r.Get("/credential", h.getCredentialMeta)
|
||||
|
||||
r.Get("/worktrees", h.listWorktrees)
|
||||
r.Post("/worktrees", h.createWorktree)
|
||||
})
|
||||
r.Route("/worktrees/{wtID}", func(r chi.Router) {
|
||||
r.Delete("/", h.deleteWorktree)
|
||||
r.Post("/acquire", h.acquireWorktree)
|
||||
r.Post("/release", h.releaseWorktree)
|
||||
r.Get("/status", h.statusOnWorktree)
|
||||
r.Post("/commit", h.commitOnWorktree)
|
||||
r.Post("/push", h.pushOnWorktree)
|
||||
})
|
||||
r.Get("/main/status", h.statusOnMain)
|
||||
r.Post("/main/commit", h.commitOnMain)
|
||||
r.Post("/main/push", h.pushOnMain)
|
||||
|
||||
r.Get("/worktrees", h.listWorktrees)
|
||||
r.Post("/worktrees", h.createWorktree)
|
||||
})
|
||||
r.With(auth).Route("/api/v1/worktrees/{wtID}", func(r chi.Router) {
|
||||
r.Delete("/", h.deleteWorktree)
|
||||
r.Post("/acquire", h.acquireWorktree)
|
||||
r.Post("/release", h.releaseWorktree)
|
||||
r.Get("/status", h.statusOnWorktree)
|
||||
r.Post("/commit", h.commitOnWorktree)
|
||||
r.Post("/push", h.pushOnWorktree)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user