helper func

This commit is contained in:
nquidox 2026-03-07 15:47:54 +03:00
parent 3f1969a6e5
commit 6d12c55785

View file

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