Browse Source

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

duxin 2 năm trước cách đây
mục cha
commit
28f7db8cc4
2 tập tin đã thay đổi với 16 bổ sung19 xóa
  1. 6 9
      .idea/workspace.xml
  2. 10 10
      service/message_mail_box.go

+ 6 - 9
.idea/workspace.xml

@@ -6,9 +6,6 @@
   <component name="ChangeListManager">
     <list default="true" id="f5220264-ecf0-4305-ada3-6105184077a7" name="Changes" comment="提交">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/rpc/messagecenter/logs/access.log" beforeDir="false" afterPath="$PROJECT_DIR$/rpc/messagecenter/logs/access.log" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/rpc/messagecenter/logs/error.log" beforeDir="false" afterPath="$PROJECT_DIR$/rpc/messagecenter/logs/error.log" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/rpc/messagecenter/logs/slow.log" beforeDir="false" afterPath="$PROJECT_DIR$/rpc/messagecenter/logs/slow.log" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/service/message_mail_box.go" beforeDir="false" afterPath="$PROJECT_DIR$/service/message_mail_box.go" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -89,7 +86,7 @@
       <recent name="D:\workspace\top_project\SocialPlatform\messageCenter\api" />
     </key>
   </component>
-  <component name="RunManager" selected="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/test 中的 Test_Count (1)">
+  <component name="RunManager" selected="Go 构建.messageRpc">
     <configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
       <module name="messageCenter" />
       <working_directory value="$PROJECT_DIR$" />
@@ -224,11 +221,11 @@
       <item itemvalue="Go 构建.messageApi_win" />
       <item itemvalue="Go 构建.messageRpc" />
       <item itemvalue="Go 构建.messageRpc_win" />
-      <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service 中的 TestChatGroupService_ChatGroupAdd/群组新增" />
-      <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service 中的 TestMessaggeService_Count/未读信息总数" />
+      <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/test 中的 Test_Count (1)" />
       <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/test 中的 Test_Count" />
       <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/test 中的 Test_test1" />
-      <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/test 中的 Test_Count (1)" />
+      <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service 中的 TestChatGroupService_ChatGroupAdd/群组新增" />
+      <item itemvalue="Go 测试.bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service 中的 TestMessaggeService_Count/未读信息总数" />
     </list>
     <recent_temporary>
       <list>
@@ -277,9 +274,9 @@
     <MESSAGE value="未读消息数量sql修改" />
     <MESSAGE value="未读sql修改" />
     <MESSAGE value="历史聊天记录查询" />
-    <MESSAGE value="提交" />
     <MESSAGE value="未读消息修改" />
-    <option name="LAST_COMMIT_MESSAGE" value="未读消息修改" />
+    <MESSAGE value="提交" />
+    <option name="LAST_COMMIT_MESSAGE" value="提交" />
   </component>
   <component name="VgoProject">
     <integration-enabled>true</integration-enabled>

+ 10 - 10
service/message_mail_box.go

@@ -625,30 +625,30 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
 	}
 	switch in.MsgType {
 	case 2: //点对点聊天
-		sqlStr = fmt.Sprintf("SELECT  a.messag_id as messageId,b.* ,if(a.own_id = a.send_user_id,1,2) as fool  "+
+		sqlStr = fmt.Sprintf("SELECT  a.messag_id as messageId,a.send_user_type,a.type AS itemType,b.* ,if(a.own_id = a.send_user_id,1,2) as fool  "+
 			"FROM  %s a  "+
-			"LEFT JOIN %s b on  a.messag_id=b.id  "+
-			"LEFT  JOIN  %s c on  c.id=a.send_user_id   "+
-			"LEFT JOIN  %s d on  d.id=a.receive_user_id  "+
-			"where  a.own_id=  %d and a.iswithdraw = 0"+
-			"AND ((a.send_user_id= %d AND   a.receive_user_id=   %d) or (a.send_user_id=  %d AND  a.receive_user_id=  %d)) "+
+			"LEFT JOIN %s b on  a.messag_id=b.id "+
+			"LEFT  JOIN  %s c on  c.id=a.send_user_id "+
+			"LEFT JOIN  %s d on  d.id=a.receive_user_id "+
+			"where  a.own_id=  %d and a.iswithdraw = 0 "+
+			"AND ((a.send_user_id= %d AND a.receive_user_id= %d) or (a.send_user_id=  %d AND a.receive_user_id=  %d)) "+
 			"AND  a.type IN ( 2, 6 )  %s "+
-			"AND a.chat_group_id = 0 "+
+			"AND a.chat_group_id IS null "+
 			"AND a.send_user_type = a.receive_user_type "+
-			"ORDER BY a.create_time desc,a.id   asc "+
+			"ORDER BY a.create_time desc,a.id asc "+
 			"limit 0 ,  %d ",
 			util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, util.BASE_USER, util.BASE_USER,
 			in.PositionId, in.PositionId, in.SendId, in.SendId, in.PositionId, lastStr, in.PageSize)
 		break
 	case 3: //群聊天
 
-		sqlStr = fmt.Sprintf("SELECT a.messag_id AS messageId,b.*,"+
+		sqlStr = fmt.Sprintf("SELECT a.messag_id AS messageId,b.*,a.send_user_type,a.type AS itemType,"+
 			"IF ( a.own_id = a.send_user_id, 1, 2 ) AS fool,"+
 			"IF ( a.own_id = a.send_user_id, 0, a.send_user_id ) AS send_position_id,"+
 			"a.send_user_type,a.type AS itemType FROM %s a "+
 			"LEFT JOIN %s b ON a.messag_id = b.id "+
 			"WHERE a.own_type = 2 AND a.own_id = %d "+
-			"AND a.chat_group_id = %d AND a.type IN ( 3, 6 )  %s"+
+			"AND a.chat_group_id = %d AND a.type IN ( 3, 6 )  %s "+
 			"ORDER BY a.create_time desc,a.id DESC "+
 			"LIMIT 0, %d",
 			util.SOCIALIZE_MESSAGE_MAILBOX, util.SOCIALIZE_MESSAGE, in.PositionId,