refactor:
- zap.Any("err", err) 更改为 zap.Error(err) 提高性能
This commit is contained in:
@@ -32,7 +32,7 @@ func (e *CustomerApi) CreateExaCustomer(c *gin.Context) {
|
||||
customer.SysUserID = utils.GetUserID(c)
|
||||
customer.SysUserAuthorityID = utils.GetUserAuthorityId(c)
|
||||
if err := customerService.CreateExaCustomer(customer); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
response.OkWithMessage("创建成功", c)
|
||||
@@ -55,7 +55,7 @@ func (e *CustomerApi) DeleteExaCustomer(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if err := customerService.DeleteExaCustomer(customer); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
response.OkWithMessage("删除成功", c)
|
||||
@@ -82,7 +82,7 @@ func (e *CustomerApi) UpdateExaCustomer(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if err := customerService.UpdateExaCustomer(&customer); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||
response.FailWithMessage("更新失败", c)
|
||||
} else {
|
||||
response.OkWithMessage("更新成功", c)
|
||||
@@ -106,7 +106,7 @@ func (e *CustomerApi) GetExaCustomer(c *gin.Context) {
|
||||
}
|
||||
err, data := customerService.GetExaCustomer(customer.ID)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
response.OkWithDetailed(exampleRes.ExaCustomerResponse{Customer: data}, "获取成功", c)
|
||||
@@ -130,7 +130,7 @@ func (e *CustomerApi) GetExaCustomerList(c *gin.Context) {
|
||||
}
|
||||
err, customerList, total := customerService.GetCustomerInfoList(utils.GetUserAuthorityId(c), pageInfo)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||
response.FailWithMessage("获取失败"+err.Error(), c)
|
||||
} else {
|
||||
response.OkWithDetailed(response.PageResult{
|
||||
|
Reference in New Issue
Block a user