Ajouter obtention de membre par API
Utiliser client API de bottin version 4 Ajouter handler GetMembre à `GET /v2/membres/{membre_id} HTTP/1.1`
This commit is contained in:
parent
b283221728
commit
bcd12582f1
4 changed files with 58 additions and 11 deletions
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"git.agecem.com/agecem/bottin-agenda/data"
|
||||
"git.agecem.com/agecem/bottin-agenda/handlers"
|
||||
bottindata "git.agecem.com/agecem/bottin/v4/data"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"github.com/spf13/cobra"
|
||||
|
@ -42,7 +42,8 @@ var apiCmd = &cobra.Command{
|
|||
bottinApiProtocol := viper.GetString("bottin.api.protocol")
|
||||
bottinApiPort := viper.GetInt("bottin.api.port")
|
||||
|
||||
bottinConnection := data.NewApiClient(
|
||||
// Using bottin's API client
|
||||
bottinConnection := bottindata.NewApiClient(
|
||||
bottinApiKey,
|
||||
bottinApiHost,
|
||||
bottinApiProtocol,
|
||||
|
@ -65,6 +66,8 @@ var apiCmd = &cobra.Command{
|
|||
|
||||
e.GET("/v2/", handlers.GetV2)
|
||||
|
||||
e.GET("/v2/membres/:membre_id", handlers.GetMembre)
|
||||
|
||||
// Check bottin is ready
|
||||
|
||||
message, err := bottinConnection.GetV4()
|
||||
|
|
Reference in a new issue