refactor:
- zap.Any("err", err) 更改为 zap.Error(err) 提高性能
This commit is contained in:
@@ -20,7 +20,7 @@ type EmailApi struct {
|
||||
// @Router /email/emailTest [post]
|
||||
func (s *EmailApi) EmailTest(c *gin.Context) {
|
||||
if err := service.ServiceGroupApp.EmailTest(); err != nil {
|
||||
global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("发送失败!", zap.Error(err))
|
||||
response.FailWithMessage("发送失败", c)
|
||||
} else {
|
||||
response.OkWithData("发送成功", c)
|
||||
@@ -38,7 +38,7 @@ func (s *EmailApi) SendEmail(c *gin.Context) {
|
||||
var email email_response.Email
|
||||
_ = c.ShouldBindJSON(&email)
|
||||
if err := service.ServiceGroupApp.SendEmail(email.To, email.Subject, email.Body); err != nil {
|
||||
global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("发送失败!", zap.Error(err))
|
||||
response.FailWithMessage("发送失败", c)
|
||||
} else {
|
||||
response.OkWithData("发送成功", c)
|
||||
|
Reference in New Issue
Block a user