diff --git a/auth/user.go b/auth/user.go index 5a9cfda..c73cb69 100644 --- a/auth/user.go +++ b/auth/user.go @@ -8,7 +8,7 @@ import ( "gorm.io/gorm" ) -//User User model +// User User model type User struct { ID string `gorm:"primaryKey"` diff --git a/server/middleware.go b/server/middleware.go index db89fe5..c36fdc4 100644 --- a/server/middleware.go +++ b/server/middleware.go @@ -32,10 +32,9 @@ func (srv *Service) Default(c *gin.Context) { c.Abort() cl.Str("error", fmt.Sprint(err)) } - if !util.PROD { - cl.Caller(2) - // cl.Str("trace", util.Stack()) - } + // if !util.PROD { + // cl.Str("trace", util.Stack()) + // } } else if c.Writer.Status() >= 400 { cl = srv.l.Error().Strs("error", c.Errors.Errors()) } else { @@ -47,6 +46,9 @@ func (srv *Service) Default(c *gin.Context) { if usr, ok := c.Get("user"); ok { cl.Str("user", usr.(string)) } + if !util.PROD { + cl.Caller(2) + } cl. Str("method", c.Request.Method). Str("ip", c.ClientIP()).