From 6d12c55785771b3a6578ceb4bd889be21a6d39bc Mon Sep 17 00:00:00 2001 From: nquidox Date: Sat, 7 Mar 2026 15:47:54 +0300 Subject: [PATCH] helper func --- internal/merch/helper.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/merch/helper.go b/internal/merch/helper.go index 95c5f02..016bd99 100644 --- a/internal/merch/helper.go +++ b/internal/merch/helper.go @@ -1,6 +1,9 @@ package merch -import log "github.com/sirupsen/logrus" +import ( + "github.com/gin-gonic/gin" + log "github.com/sirupsen/logrus" +) const ( pkgLogHeader = "Merch" @@ -27,3 +30,8 @@ func logDebugController(msg string) { func logErrController(err error) { log.WithError(err).Errorf("%v %v", pkgLogHeader, controllerLogHeader) } + +func getUserId(c *gin.Context) int64 { + id, _ := c.Get("userId") + return id.(int64) +}