Mettre à jour avec bottin api v5
This commit is contained in:
parent
bcd12582f1
commit
8adb253f47
6 changed files with 31 additions and 29 deletions
|
@ -3,18 +3,18 @@ package handlers
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"git.agecem.com/agecem/bottin-agenda/data"
|
||||
bottindata "git.agecem.com/agecem/bottin/v5/data"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func GetV2(c echo.Context) error {
|
||||
func GetHealth(c echo.Context) error {
|
||||
bottinApiKey := viper.GetString("bottin.api.key")
|
||||
bottinApiHost := viper.GetString("bottin.api.host")
|
||||
bottinApiProtocol := viper.GetString("bottin.api.protocol")
|
||||
bottinApiPort := viper.GetInt("bottin.api.port")
|
||||
|
||||
bottinConnection := data.NewApiClient(
|
||||
bottinConnection := bottindata.NewApiClient(
|
||||
bottinApiKey,
|
||||
bottinApiHost,
|
||||
bottinApiProtocol,
|
||||
|
@ -23,11 +23,11 @@ func GetV2(c echo.Context) error {
|
|||
|
||||
var bottinStatus string
|
||||
|
||||
message, err := bottinConnection.GetV4()
|
||||
healthResponse, err := bottinConnection.GetHealth()
|
||||
if err != nil {
|
||||
bottinStatus = err.Error()
|
||||
} else {
|
||||
bottinStatus = message
|
||||
bottinStatus = healthResponse
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, map[string]string{
|
|
@ -6,7 +6,7 @@ import (
|
|||
"github.com/labstack/echo/v4"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
bottindata "git.agecem.com/agecem/bottin/v4/data"
|
||||
bottindata "git.agecem.com/agecem/bottin/v5/data"
|
||||
)
|
||||
|
||||
func GetMembre(c echo.Context) error {
|
||||
|
|
Reference in a new issue