import other kontor repos into directories
This commit is contained in:
committed by
Thomas Peetz
parent
28746adfbb
commit
b424e95e05
@@ -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,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user