helper func
This commit is contained in:
parent
3f1969a6e5
commit
6d12c55785
1 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
package merch
|
package merch
|
||||||
|
|
||||||
import log "github.com/sirupsen/logrus"
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
pkgLogHeader = "Merch"
|
pkgLogHeader = "Merch"
|
||||||
|
|
@ -27,3 +30,8 @@ func logDebugController(msg string) {
|
||||||
func logErrController(err error) {
|
func logErrController(err error) {
|
||||||
log.WithError(err).Errorf("%v %v", pkgLogHeader, controllerLogHeader)
|
log.WithError(err).Errorf("%v %v", pkgLogHeader, controllerLogHeader)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getUserId(c *gin.Context) int64 {
|
||||||
|
id, _ := c.Get("userId")
|
||||||
|
return id.(int64)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue