add rest client
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
2026-09-27 03:09:22 +02:00
parent f0f1819a1f
commit 2d6fa7b7ee
17 changed files with 243 additions and 21 deletions
+8 -1
View File
@@ -1,9 +1,11 @@
package handlers
import (
"kontor-api-gin/internal/helpers"
"kontor-api-gin/internal/service"
"net/http"
"github.com/gin-contrib/slog"
"github.com/gin-gonic/gin"
)
@@ -12,5 +14,10 @@ type AuthHandler struct {
}
func (handler *AuthHandler) Login(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"token": "bla"})
token, err := helpers.GenerateToken("bla")
logger := slog.Get(c)
if err != nil {
logger.Info("Login", "GenerateToken error", err.Error())
}
c.JSON(http.StatusOK, gin.H{"token": token})
}