[feature] Merged with api-prototype

This commit is contained in:
PB
2022-06-19 15:19:05 +02:00
parent 748b631d0c
commit c44ec98e39
16 changed files with 534 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
package handler
import (
"net/http"
)
var HealthCheckHandler *Handler
func init() {
HealthCheckHandler = &Handler{
Handle: HealthCheckHandlerFunc,
Request: &HealthCheckRequest{},
Response: &HealthCheckResponse{},
}
}
type HealthCheckRequest struct {
}
type HealthCheckResponse struct {
Status string `json:"status"`
Data *HealthCheckResponseBody `json:"data"`
}
type HealthCheckResponseBody struct {
Message string `json:"message,omitempty"`
}
func HealthCheckHandlerFunc(_ *Handler, w http.ResponseWriter) (interface{}, int, error) {
return &HealthCheckResponseBody{
Message: "This is welcome health message. Everything seems to be alright ;)",
}, http.StatusOK, nil
// return &HealthCheckResponse{
// Status: http.StatusText(http.StatusOK),
// Data: &HealthCheckResponseBody{
// Message: "This is welcome health message. Everything seems to be alright ;)",
// },
// }, http.StatusOK, nil
}