ソースを参照

Merge remote-tracking branch 'origin/feature/v1.2.6' into dev/v1.2.6_dx

duxin 2 年 前
コミット
45814a8c8a

+ 10 - 2
rpc/messagecenter/internal/logic/savemessagelogic.go

@@ -1,13 +1,14 @@
 package logic
 
 import (
+	"context"
+
 	quitl "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
-	"context"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -30,7 +31,14 @@ func NewSaveMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveM
 func (l *SaveMessageLogic) SaveMessage(in *messagecenter.MessageEntity) (*messagecenter.SaveMessageResp, error) {
 	// todo: add your logic here and delete this line
 	m := service.MessaggeService{}
-	fool, error_message, content, messageId, nowTime := m.SaveMessage(in)
+	fool, error_message, content, messageId, nowTime := func() (fool bool, errorMsg string, content string, messageId, nowInt int64) {
+		if in.ItemType != 7 {
+			return m.SaveMessage(in)
+		} else {
+			return m.Chat(in)
+		}
+	}()
+
 	error_code := util.SUCCESS_CODE
 	if fool {
 		error_code = util.SUCCESS_CODE

+ 2 - 2
service/message_mail_box.go

@@ -1010,7 +1010,7 @@ func (b MessaggeService) AppraiseMessage(in *messagecenter.AppraiseReq) error {
 /*
 入参 appid,title,content,sendid,link,item,messagetype,receiverIds,groupIds
 */
-func (this *MessaggeService) Chat(in *messagecenter.MessageSaveReq) (fool bool, errorMsg string, content string, messageId, nowInt int64) {
+func (this *MessaggeService) Chat(in *messagecenter.MessageEntity) (fool bool, errorMsg string, content string, messageId, nowInt int64) {
 	now := time.Now()
 	nowTime := now.Format(date.Date_Full_Layout)
 	messageId = int64(0)
@@ -1018,7 +1018,7 @@ func (this *MessaggeService) Chat(in *messagecenter.MessageSaveReq) (fool bool,
 		isGroup := len(in.GroupIds) > 0
 		isOneToOne := len(in.ReceiverIds) > 0
 		createperson := strconv.Itoa(int(in.SendId))
-		messageId = MessageAdd(tx, in.Appid, in.Title, in.Content, createperson, in.Link, in.Item, in.MessageType)
+		messageId = MessageAdd(tx, in.Appid, in.Title, in.Content, createperson, in.Link, in.Item, in.Type)
 		//是否客服介入
 		isCustomerServiceAccess := 0