Skip to content

Commit

Permalink
updates routes for CRUD
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwiniag committed Dec 25, 2024
1 parent a9939cd commit 1fac9c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/restapi/v1/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
integrationtype1 "github.com/shinobistack/gokakashi/internal/restapi/v1/integrationtype"
policies1 "github.com/shinobistack/gokakashi/internal/restapi/v1/policies"
policylabels1 "github.com/shinobistack/gokakashi/internal/restapi/v1/policylabels"
scanlabels1 "github.com/shinobistack/gokakashi/internal/restapi/v1/scanlabels"
scans1 "github.com/shinobistack/gokakashi/internal/restapi/v1/scans"

"github.com/swaggest/openapi-go/openapi31"
Expand Down Expand Up @@ -77,6 +78,12 @@ func (srv *Server) Service() *web.Service {
apiV1.Put("/scans/{id}", usecase.NewInteractor(scans1.UpdateScan(srv.DB)))
apiV1.Delete("/scans/{id}", usecase.NewInteractor(scans1.DeleteScan(srv.DB)))

apiV1.Post("/scans/{scan_id}/labels", usecase.NewInteractor(scanlabels1.CreateScanLabel(srv.DB)))
apiV1.Get("/scans/{scan_id}/labels", usecase.NewInteractor(scanlabels1.ListScanLabels(srv.DB)))
apiV1.Get("/scans/{scan_id}/labels/{key}", usecase.NewInteractor(scanlabels1.GetScanLabel(srv.DB)))
apiV1.Put("/scans/{scan_id}/labels", usecase.NewInteractor(scanlabels1.UpdateScanLabel(srv.DB)))
apiV1.Delete("/scans/{scan_id}/labels/{key}", usecase.NewInteractor(scanlabels1.DeleteScanLabel(srv.DB)))

s.Mount("/api/v1/openapi.json", specHandler(apiV1.OpenAPICollector.SpecSchema().(*openapi31.Spec)))
s.Mount("/api/v1", apiV1)

Expand Down

0 comments on commit 1fac9c4

Please sign in to comment.