[BREAKING] Bump à version 3 #15

Merged
vlbeaudoin merged 5 commits from breaking/remove-membre-route into main 2023-06-08 21:11:28 -04:00
2 changed files with 20 additions and 5 deletions
Showing only changes of commit 53c5d8f1c6 - Show all commits

View file

@ -4,12 +4,16 @@ import (
"net/http"
"git.agecem.com/agecem/bottin-agenda/data"
"git.agecem.com/agecem/bottin-agenda/responses"
bottindata "git.agecem.com/agecem/bottin/v5/data"
"github.com/labstack/echo/v4"
"github.com/spf13/viper"
)
func GetHealth(c echo.Context) error {
var response responses.GetHealthResponse
var statusCode int = http.StatusNotImplemented
bottinApiKey := viper.GetString("bottin.api.key")
bottinApiHost := viper.GetString("bottin.api.host")
bottinApiProtocol := viper.GetString("bottin.api.protocol")
@ -48,9 +52,10 @@ func GetHealth(c echo.Context) error {
}
}
return c.JSON(http.StatusOK, map[string]string{
"message": "Bottin-agenda API v2 is ready",
"bottin": bottinStatus,
"database": databaseStatus,
})
statusCode = http.StatusOK
response.Message = "Bottin-agenda API v3 is ready"
response.Data.Bottin = bottinStatus
response.Data.Database = databaseStatus
return c.JSON(statusCode, response)
}

View file

@ -4,6 +4,16 @@ import (
"git.agecem.com/agecem/bottin-agenda/models"
)
type GetHealthResponseData struct {
Bottin string `json:"bottin"`
Database string `json:"database"`
}
type GetHealthResponse struct {
Message string `json:"message"`
Data GetHealthResponseData `json:"data"`
}
type PostSeedResponse struct {
Message string `json:"message"`
}