Эх сурвалжийг харах

Merge branch 'dev/v1.2.6_dx' of SocialPlatform/messageCenter into feature/v1.2.6

duxin 2 жил өмнө
parent
commit
4c41ba9fde

+ 6 - 7
api/messagecenter/internal/logic/updatereadbyidlogic.go

@@ -28,13 +28,12 @@ func NewUpdateReadByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up
 
 func (l *UpdateReadByIdLogic) UpdateReadById(req *types.ReadStateReq) (*types.CommonRes, error) {
 	readStateReq := &messagecenter.ReadStateReq{
-		SendId:      quitl.Int64All(encrypt.SE.Decode4Hex(req.SendId)),
-		EntUserId:   req.EntUserId,
-		NewUserId:   req.NewUserId,
-		PositionId:  req.PositionId,
-		MsgType:     req.MsgType,
-		UserType:    req.UserType,
-		ChatGroupId: req.ChatGroupId,
+		SendId:     quitl.Int64All(encrypt.SE.Decode4Hex(req.SendId)),
+		EntUserId:  req.EntUserId,
+		NewUserId:  req.NewUserId,
+		PositionId: req.PositionId,
+		SendType:   req.SendType,
+		UserType:   req.UserType,
 	}
 	resp, err := l.svcCtx.Message.UpdateReadById(l.ctx, readStateReq)
 	if err != nil {

+ 6 - 7
api/messagecenter/internal/types/types.go

@@ -92,13 +92,12 @@ type ShuntReq struct {
 }
 
 type ReadStateReq struct {
-	SendId      string `json:"sendId"`
-	EntUserId   int64  `header:"entUserId,optional"`
-	NewUserId   int64  `header:"newUserId,optional"`
-	PositionId  int64  `header:"positionId,optional"`
-	ChatGroupId int64  `json:"chatGroupId,optional"`
-	UserType    int64  `json:"userType,optional"`
-	MsgType     int64  `json:"msgType,optional"`
+	SendId     string `json:"sendId"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	NewUserId  int64  `header:"newUserId,optional"`
+	PositionId int64  `header:"positionId,optional"`
+	UserType   int64  `json:"userType,optional"`
+	SendType   int64  `json:"sendType,optional"`
 }
 
 type ReadWithdrawReq struct {

+ 6 - 7
api/messagecenter/messagecenter.api

@@ -83,13 +83,12 @@ type ShuntReq {
 	Type string `json:"type"`
 }
 type ReadStateReq {
-	SendId      string `json:"sendId"`
-	EntUserId   int64  `header:"entUserId,optional"`
-	NewUserId   int64  `header:"newUserId,optional"`
-	PositionId  int64  `header:"positionId,optional"`
-	ChatGroupId int64  `json:"chatGroupId,optional"`
-	UserType    int64  `json:"userType,optional"`
-	MsgType     int64  `json:"msgType,optional"`
+	SendId     string `json:"sendId"`
+	EntUserId  int64  `header:"entUserId,optional"`
+	NewUserId  int64  `header:"newUserId,optional"`
+	PositionId int64  `header:"positionId,optional"`
+	UserType   int64  `json:"userType,optional"`
+	SendType   int64  `json:"sendType,optional"`
 }
 type ReadWithdrawReq {
 	MessageId        string `json:"messageId"`

+ 1 - 8
rpc/messagecenter/internal/logic/updatereadbyidlogic.go

@@ -29,16 +29,9 @@ func (l *UpdateReadByIdLogic) UpdateReadById(in *messagecenter.ReadStateReq) (*m
 	// todo: add your logic here and delete this line
 
 	m := service.MessaggeService{}
-	fool := m.UpdateReadById(in)
+	m.UpdateReadById(in)
 	error_message := ""
 	error_code := util.SUCCESS_CODE
-	if fool {
-		error_code = util.SUCCESS_CODE
-		error_message = ""
-	} else {
-		error_code = util.ERROR_CODE
-		error_message = "修改失败"
-	}
 	return &messagecenter.CurrencyResp{
 		ErrorCode: error_code,
 		ErrorMsg:  error_message,

+ 2 - 3
rpc/messagecenter/messagecenter.proto

@@ -134,9 +134,8 @@ message ReadStateReq {
   int64         entUserId = 2;
   int64         newUserId = 3;
   int64         sendId = 4;
-  int64         chatGroupId = 5;
-  int64         userType = 6;
-  int64         msgType = 7;
+  int64         userType = 5;
+  int64         sendType = 6;
 }
 
 message ReadWithdrawReq {

+ 13 - 23
rpc/messagecenter/messagecenter/messagecenter.pb.go

@@ -1300,13 +1300,12 @@ type ReadStateReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	PositionId  int64 `protobuf:"varint,1,opt,name=positionId,proto3" json:"positionId,omitempty"`
-	EntUserId   int64 `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
-	NewUserId   int64 `protobuf:"varint,3,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
-	SendId      int64 `protobuf:"varint,4,opt,name=sendId,proto3" json:"sendId,omitempty"`
-	ChatGroupId int64 `protobuf:"varint,5,opt,name=chatGroupId,proto3" json:"chatGroupId,omitempty"`
-	UserType    int64 `protobuf:"varint,6,opt,name=userType,proto3" json:"userType,omitempty"`
-	MsgType     int64 `protobuf:"varint,7,opt,name=msgType,proto3" json:"msgType,omitempty"`
+	PositionId int64 `protobuf:"varint,1,opt,name=positionId,proto3" json:"positionId,omitempty"`
+	EntUserId  int64 `protobuf:"varint,2,opt,name=entUserId,proto3" json:"entUserId,omitempty"`
+	NewUserId  int64 `protobuf:"varint,3,opt,name=newUserId,proto3" json:"newUserId,omitempty"`
+	SendId     int64 `protobuf:"varint,4,opt,name=sendId,proto3" json:"sendId,omitempty"`
+	UserType   int64 `protobuf:"varint,5,opt,name=userType,proto3" json:"userType,omitempty"`
+	SendType   int64 `protobuf:"varint,6,opt,name=sendType,proto3" json:"sendType,omitempty"`
 }
 
 func (x *ReadStateReq) Reset() {
@@ -1369,13 +1368,6 @@ func (x *ReadStateReq) GetSendId() int64 {
 	return 0
 }
 
-func (x *ReadStateReq) GetChatGroupId() int64 {
-	if x != nil {
-		return x.ChatGroupId
-	}
-	return 0
-}
-
 func (x *ReadStateReq) GetUserType() int64 {
 	if x != nil {
 		return x.UserType
@@ -1383,9 +1375,9 @@ func (x *ReadStateReq) GetUserType() int64 {
 	return 0
 }
 
-func (x *ReadStateReq) GetMsgType() int64 {
+func (x *ReadStateReq) GetSendType() int64 {
 	if x != nil {
-		return x.MsgType
+		return x.SendType
 	}
 	return 0
 }
@@ -2269,7 +2261,7 @@ var file_messagecenter_proto_rawDesc = []byte{
 	0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x6f, 0x77, 0x46, 0x6f, 0x72,
 	0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x77, 0x46, 0x6f,
-	0x72, 0x6d, 0x61, 0x74, 0x22, 0xda, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61,
+	0x72, 0x6d, 0x61, 0x74, 0x22, 0xba, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x61,
 	0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
 	0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x73, 0x69, 0x74,
 	0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72,
@@ -2277,12 +2269,10 @@ var file_messagecenter_proto_rawDesc = []byte{
 	0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
 	0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x49,
 	0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61,
-	0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b,
-	0x63, 0x68, 0x61, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75,
-	0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75,
-	0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79,
-	0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70,
+	0x03, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65,
+	0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65,
+	0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70,
+	0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70,
 	0x65, 0x22, 0x83, 0x02, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x64, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72,
 	0x61, 0x77, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
 	0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,

+ 3 - 4
service/message_mail_box.go

@@ -919,7 +919,6 @@ func (b *MessaggeService) SaveAutoReplyMsg(userType, entId, entUserId, userId in
 	return ok1, messageId
 }
 
-// 修改未读状态
 // 修改未读状态
 func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
 	updateMap := map[string]interface{}{}
@@ -946,18 +945,18 @@ func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
 			"AND a.type IN (3,6) "+
 			"AND a.isread = 0 "+
 			"AND a.own_id = %d AND a.chat_group_id = %d",
-			util.SOCIALIZE_MESSAGE_MAILBOX, in.SendId, in.ChatGroupId)
+			util.SOCIALIZE_MESSAGE_MAILBOX, in.PositionId, in.SendId)
 		IC.BaseMysql.UpdateOrDeleteBySql(sqlStr)
 		//更新socialize_summary表未读消息数量
 		updateQuery := map[string]interface{}{
 			"my_position_id": in.PositionId,
-			"chat_group_id":  in.ChatGroupId,
+			"chat_group_id":  in.SendId,
 		}
 		IC.BaseMysql.Update(util.SOCIALIZE_SUMMARY, updateQuery, map[string]interface{}{"unread": 0})
 	case 2: // 客服聊天
 		unreadSql := ""
 		positionStr := GetUserAllPosition(in.NewUserId)
-		if in.MsgType == 1 { //1客服
+		if in.SendType == 1 { //1客服
 			sqlStr = fmt.Sprintf("UPDATE %s a  SET a.isread = 1,    a.read_time = now( )  "+
 				"WHERE    a.own_type = 1 and a.iswithdraw = 0 "+
 				"AND a.type IN ( 4,5,6,7)  "+