|
@@ -86,7 +86,7 @@ func (l *PublishInfoLogic) PublishInfo(in *consumerinfo.PublishInfoReq) (*consum
|
|
}
|
|
}
|
|
if id < 1 {
|
|
if id < 1 {
|
|
res.ErrCode = -1
|
|
res.ErrCode = -1
|
|
- res.ErrMsg = "信息发布失败"
|
|
|
|
|
|
+ res.ErrMsg = "信息保存失败"
|
|
return &res, nil
|
|
return &res, nil
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105,10 +105,18 @@ func (l *PublishInfoLogic) PublishInfo(in *consumerinfo.PublishInfoReq) (*consum
|
|
}
|
|
}
|
|
log.Println("发送nsq敏感词信息", model.NsqConfig, appendInfo)
|
|
log.Println("发送nsq敏感词信息", model.NsqConfig, appendInfo)
|
|
nsq, err := util.NewNsqInfo(model.NsqConfig.Ip, model.NsqConfig.Topic, mc.InterfaceToStr(id), "1", mc.InterfaceToStr(in.MsgType), false, appendInfo)
|
|
nsq, err := util.NewNsqInfo(model.NsqConfig.Ip, model.NsqConfig.Topic, mc.InterfaceToStr(id), "1", mc.InterfaceToStr(in.MsgType), false, appendInfo)
|
|
- if err != nil || nsq.NsqPushInfo() != nil {
|
|
|
|
- log.Println("信息发布失败nsq++++++++++++", model.NsqConfig, appendInfo)
|
|
|
|
|
|
+
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Println("初始化NSQ信息失败")
|
|
res.ErrCode = -1
|
|
res.ErrCode = -1
|
|
- res.ErrMsg = fmt.Sprintf("信息发布失败")
|
|
|
|
|
|
+ res.ErrMsg = err.Error()
|
|
|
|
+ return &res, nil
|
|
|
|
+ }
|
|
|
|
+ if err := nsq.NsqPushInfo(); err != nil {
|
|
|
|
+ log.Println("发送nsq敏感词信息失败nsq++++++++++++", model.NsqConfig, appendInfo, err.Error())
|
|
|
|
+ res.ErrCode = -1
|
|
|
|
+ res.ErrMsg = err.Error()
|
|
|
|
+ return &res, nil
|
|
}
|
|
}
|
|
if in.MsgType == 3 {
|
|
if in.MsgType == 3 {
|
|
entNameKye := fmt.Sprintf("userEntName_%s_%d_%d", in.UserId, id, in.MsgType)
|
|
entNameKye := fmt.Sprintf("userEntName_%s_%d_%d", in.UserId, id, in.MsgType)
|