import sources from develop/0.1.0

This commit is contained in:
Thomas Peetz
2025-04-29 12:52:55 +02:00
parent 304005822c
commit 4c96de27db
976 changed files with 58265 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
package responses
// Response is the Ping Response
type Response struct {
Message string `json:"message"`
}
type ComicList struct {
Comics []Comic `json:"comics"`
}
type Comic struct {
ID string `json:"id"`
Title string `json:"title"`
}
+33
View File
@@ -0,0 +1,33 @@
package routing
import (
"net/http"
"gitlab.com/tpeetz-kontor/kontor-go/cmd/pkg/context/comic/responses"
"gitlab.com/tpeetz-kontor/kontor-go/cmd/pkg/infrastructure/app"
responseFactory "gitlab.com/tpeetz-kontor/kontor-go/cmd/pkg/infrastructure/response"
)
// Handler is the http.Handler for this request
type Handler struct {
app *app.Application
}
// NewHandler will create a new Handler to handle this request
func NewHandler(app *app.Application) *Handler {
return &Handler{app}
}
// Handle will handle the incoming request
func (handler *Handler) ComicList(response http.ResponseWriter, request *http.Request) {
handler.app.Logger.Info("Ping Handler Dispatched.")
responseFactory.Send(
response,
http.StatusOK,
&responses.ComicList{
Comics: []responses.Comic{{ID: "123", Title: "Comic1"}, {ID: "123", Title: "Comic1"}},
},
handler.app.Config.HTTP.Content,
)
}