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) +}