diff --git a/internal/handler/v2/service/datasharing/service_show_data_sharing_ui.go b/internal/handler/v2/service/datasharing/service_show_data_sharing_ui.go new file mode 100644 index 0000000..598432a --- /dev/null +++ b/internal/handler/v2/service/datasharing/service_show_data_sharing_ui.go @@ -0,0 +1,51 @@ +package datasharing + +import ( + "html/template" + "net/http" +) + +func ServiceShowDataSharingUiHandler(w http.ResponseWriter, r *http.Request) { + // HTML template + templateContent := ` + + + + + + Consent BB Data Sharing UI + + + +
+ + + + + + ` + + // Parse the HTML template + tmpl := template.New("my-template") + tmpl, err := tmpl.Parse(templateContent) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // Execute the template with the data + err = tmpl.Execute(w, nil) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } +} diff --git a/internal/http_path/v2/routes.go b/internal/http_path/v2/routes.go index b54cca1..9d60450 100644 --- a/internal/http_path/v2/routes.go +++ b/internal/http_path/v2/routes.go @@ -12,6 +12,7 @@ import ( webhookHandler "github.com/bb-consent/api/internal/handler/v2/config/webhook" onboardHandler "github.com/bb-consent/api/internal/handler/v2/onboard" serviceHandler "github.com/bb-consent/api/internal/handler/v2/service" + serviceDataSharingHandler "github.com/bb-consent/api/internal/handler/v2/service/datasharing" serviceIndividualHandler "github.com/bb-consent/api/internal/handler/v2/service/individual" m "github.com/bb-consent/api/internal/middleware" "github.com/casbin/casbin/v2" @@ -161,4 +162,6 @@ func SetRoutes(r *mux.Router, e *casbin.Enforcer) { r.Handle(OnboardUpdateOrganisationAdminAvatar, m.Chain(onboardHandler.OnboardUpdateOrganisationAdminAvatar, m.Logger(), m.Authorize(e), m.SetApplicationMode(), m.Authenticate(), m.AddContentType())).Methods("PUT") r.Handle(OnboardReadStatus, m.Chain(onboardHandler.OnboardReadStatus, m.Logger(), m.Authorize(e), m.SetApplicationMode(), m.Authenticate(), m.AddContentType())).Methods("GET") + + r.Handle(ServiceShowDataSharingUi, m.Chain(serviceDataSharingHandler.ServiceShowDataSharingUiHandler, m.LoggerNoAuth())).Methods("GET") } diff --git a/internal/http_path/v2/service_paths.go b/internal/http_path/v2/service_paths.go index e6d3781..5b0e518 100644 --- a/internal/http_path/v2/service_paths.go +++ b/internal/http_path/v2/service_paths.go @@ -44,3 +44,6 @@ const ServiceCreateIndividual = "/v2/service/individual" const ServiceReadIndividual = "/v2/service/individual/{individualId}" const ServiceUpdateIndividual = "/v2/service/individual/{individualId}" const ServiceListIndividuals = "/v2/service/individuals" + +// Data sharing +const ServiceShowDataSharingUi = "/data-sharing-ui" diff --git a/resources/config b/resources/config index 7c4ac2d..c3d8b20 160000 --- a/resources/config +++ b/resources/config @@ -1 +1 @@ -Subproject commit 7c4ac2dd95ca7a5c32decec160da1490b86ba8e8 +Subproject commit c3d8b2051ff3978f7ac127946a9af2f524975282