feat(backend): use interpreters service for jobs handlers

This commit is contained in:
2026-04-04 16:38:29 +03:00
parent f5b9b32a9f
commit 9ede6257f8
2 changed files with 31 additions and 8 deletions
+9 -1
View File
@@ -94,6 +94,7 @@ func main() {
}
scriptSvc := service.NewScriptService(scriptRepo)
scriptHandlers := handlers.NewScriptHandlers(scriptSvc, cmdr)
jobsHandlers := handlers.NewJobsHandlers(cmdr, scriptSvc)
agents := handlers.NewAgentsGroup(h, coll)
auth := handlers.AuthGroup{Handlers: h}
@@ -173,6 +174,13 @@ func main() {
agentsGroup.GET("", agents.List)
}
// Jobs (requires admin permission)
jobsGroup := v1.Group("/jobs")
jobsGroup.Use(auth.AuthMiddleware(), handlers.RequireAdmin())
{
jobsGroup.POST("", jobsHandlers.AddJob)
}
// Agent registration
agentRegGroup := v1.Group("/agents")
{
@@ -291,4 +299,4 @@ func main() {
if err := g.Wait(); err != nil {
log.Fatalf("Server error: %v", err)
}
}
}