mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-23 23:43:12 +01:00
Release catalyst
This commit is contained in:
28
service/template.go
Normal file
28
service/template.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/SecurityBrewery/catalyst/generated/restapi/api"
|
||||
"github.com/SecurityBrewery/catalyst/generated/restapi/operations/templates"
|
||||
)
|
||||
|
||||
func (s *Service) CreateTemplate(ctx context.Context, params *templates.CreateTemplateParams) *api.Response {
|
||||
return response(s.database.TemplateCreate(ctx, params.Template))
|
||||
}
|
||||
|
||||
func (s *Service) GetTemplate(ctx context.Context, params *templates.GetTemplateParams) *api.Response {
|
||||
return response(s.database.TemplateGet(ctx, params.ID))
|
||||
}
|
||||
|
||||
func (s *Service) UpdateTemplate(ctx context.Context, params *templates.UpdateTemplateParams) *api.Response {
|
||||
return response(s.database.TemplateUpdate(ctx, params.ID, params.Template))
|
||||
}
|
||||
|
||||
func (s *Service) DeleteTemplate(ctx context.Context, params *templates.DeleteTemplateParams) *api.Response {
|
||||
return response(nil, s.database.TemplateDelete(ctx, params.ID))
|
||||
}
|
||||
|
||||
func (s *Service) ListTemplates(ctx context.Context) *api.Response {
|
||||
return response(s.database.TemplateList(ctx))
|
||||
}
|
||||
Reference in New Issue
Block a user