Ver Fonte

feat:日志

wangshan há 3 anos atrás
pai
commit
f8ca9e098d
1 ficheiros alterados com 6 adições e 4 exclusões
  1. 6 4
      rpc/common/internal/logic/sensitivemethodlogic.go

+ 6 - 4
rpc/common/internal/logic/sensitivemethodlogic.go

@@ -7,6 +7,7 @@ import (
 	"app.yhyue.com/moapp/jybase/redis"
 	"context"
 	"fmt"
+	"log"
 	"strings"
 	"time"
 
@@ -31,13 +32,14 @@ func NewSensitiveMethodLogic(ctx context.Context, svcCtx *svc.ServiceContext) *S
 	}
 }
 
+//敏感词过滤后接受结果
 func (l *SensitiveMethodLogic) SensitiveMethod(in *common.SensitiveRequest) (*common.SensitiveResponse, error) {
 	var (
 		resp common.SensitiveResponse
 		//isSensitive 是否有敏感词  isPublishInfo招标信息是否需要自动发布 isPublishSup 供应信息是否需要自动发布
 		isSensitive, isPublishInfo, isPublishSup bool
 	)
-	fmt.Println("接收到敏感词回调----------------------", in)
+	log.Println("接收到敏感词回调----------------------", in)
 	upData := make(map[string]interface{})
 	query := make(map[string]interface{})
 	if in.Title != nil || in.Detail != nil || in.Attachments != "" || in.AttachTxt != "" {
@@ -114,19 +116,19 @@ func (l *SensitiveMethodLogic) SensitiveMethod(in *common.SensitiveRequest) (*co
 				supInfo["province"] = (*data)["province"]
 				supInfo["city"] = (*data)["city"]
 				if !model.SaveSupplyInfo(entName, supInfo) {
-					resp.ErrCode = 1
+					resp.ErrCode = -1
 					resp.ErrMsg = "调用SaveSupplyInfo失败,供应信息发布失败"
 					break
 				}
 			}
 
 			if !md.Mysql.Update("supply_info", query, upData) {
-				resp.ErrCode = 1
+				resp.ErrCode = -1
 				resp.ErrMsg = "调用信息发布成功,更新信息失败"
 			}
 		}
 	default:
-		resp.ErrCode = 1
+		resp.ErrCode = -2
 		resp.ErrMsg = "信息类型错误"
 	}