Browse Source

字段类型修改

WH01243 3 years ago
parent
commit
c484cfc442

+ 3 - 1
api/messagecenter/internal/logic/updatereadbyidlogic.go

@@ -1,6 +1,8 @@
 package logic
 
 import (
+	quitl "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
 	"context"
 
@@ -25,7 +27,7 @@ func NewUpdateReadByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up
 }
 
 func (l *UpdateReadByIdLogic) UpdateReadById(req *types.ReadStateReq) (*types.CommonRes, error) {
-	readStateReq := &messagecenter.ReadStateReq{MessageId: req.MessageId}
+	readStateReq := &messagecenter.ReadStateReq{MessageId: quitl.Int64All(encrypt.SE.Decode4Hex(req.MessageId))}
 	resp, err := l.svcCtx.Message.UpdateReadById(l.ctx, readStateReq)
 	if err != nil {
 		return nil, err

+ 1 - 1
api/messagecenter/internal/types/types.go

@@ -77,5 +77,5 @@ type ShuntReq struct {
 }
 
 type ReadStateReq struct {
-	MessageId int64 `json:"messageId"`
+	MessageId string `json:"messageId"`
 }

+ 1 - 1
api/messagecenter/messagecenter.api

@@ -67,7 +67,7 @@ type ShuntReq {
 	Type string `json:"type"`
 }
 type ReadStateReq {
-	MessageId int64 `json:"messageId"`
+	MessageId string `json:"messageId"`
 }
 service messagecenter-api {
 	@handler messageCount

+ 1 - 1
service/message_mail_box_test.go

@@ -281,7 +281,7 @@ func TestMessaggeService_SaveAutoReplyMsg(t *testing.T) {
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
 			m := &MessaggeService{}
-			if got := m.SaveAutoReplyMsg(tt.args.userType, tt.args.entId, tt.args.entUserId, tt.args.userId, tt.args.content, tt.args.appId, tt.args.nowFormat); got != tt.want {
+			if got, _ := m.SaveAutoReplyMsg(tt.args.userType, tt.args.entId, tt.args.entUserId, tt.args.userId, tt.args.content, tt.args.appId, tt.args.nowFormat); got != tt.want {
 				t.Errorf("SaveAutoReplyMsg() = %v, want %v", got, tt.want)
 			}
 		})