2020-09-08 10:50:41 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2022-11-06 15:36:31 +00:00
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
2020-09-08 10:50:41 +00:00
|
|
|
)
|
|
|
|
|
2022-11-06 15:36:31 +00:00
|
|
|
func declareVersionRoutes(router *gin.RouterGroup) {
|
|
|
|
router.GET("/version", showVersion)
|
2020-09-08 10:50:41 +00:00
|
|
|
}
|
|
|
|
|
2022-11-06 15:36:31 +00:00
|
|
|
func showVersion(c *gin.Context) {
|
|
|
|
teamid := c.MustGet("LoggedTeam").(int64)
|
|
|
|
ficteam := c.MustGet("LoggedUser").(string)
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, gin.H{
|
|
|
|
"version": 0.2,
|
|
|
|
"auth": map[string]interface{}{
|
|
|
|
"name": ficteam,
|
|
|
|
"id_team": teamid,
|
|
|
|
},
|
|
|
|
})
|
2020-09-08 10:50:41 +00:00
|
|
|
}
|