Browse Source

1.修改消息code常量

master
wangwanlei 9 months ago
parent
commit
835f2dd4d0
1 changed files with 15 additions and 17 deletions
  1. 15
    17
      websocket/src/main/java/com/xhly/websocket/utils/SocketPushUtils.kt

+ 15
- 17
websocket/src/main/java/com/xhly/websocket/utils/SocketPushUtils.kt View File

@@ -1,5 +1,6 @@
1 1
 package com.xhly.websocket.utils
2 2
 
3
+import com.xhly.corelib.Const
3 4
 import com.xhly.corelib.eventbus.UIEvent
4 5
 import com.xhly.corelib.utils.GsonUtils
5 6
 import com.xhly.corelib.utils.LogShow
@@ -17,45 +18,42 @@ object SocketPushUtils {
17 18
                         //连接后回发 body{userid,username,usertype(1管理员,2学生)}
18 19
                     }
19 20
 
20
-                    1002 -> {
21
-                        //获取在线用户列表
22
-                    }
23
-
24
-                    1003 -> {
25
-                        //返回在线用户列表 body{userlist(userid,username)}
26
-                    }
27
-
28
-                    2001 -> {
21
+                    Const.CODE2001 -> {
29 22
                         //发送消息 body{userid,username,msg}
30
-                        UIEvent("2001").post()
23
+                        UIEvent(Const.CODE2001.toString()).post()
31 24
                     }
32 25
 
33
-                    2002 -> {
26
+                    Const.CODE2002 -> {
34 27
                         //限制使用
35 28
                     }
36 29
 
37
-                    2003 -> {
30
+                    Const.CODE2003 -> {
38 31
                         //解除限制
39 32
 
40 33
                     }
41 34
 
42
-                    2004 -> {
35
+                    Const.CODE2004 -> {
43 36
                         //更新策略
44 37
                     }
45 38
 
46
-                    2005 -> {
39
+                    Const.CODE2005 -> {
47 40
                         //重启设备
48 41
                     }
49 42
 
50
-                    2006 -> {
43
+                    Const.CODE2006 -> {
51 44
                         //恢复出厂
45
+                        UIEvent(Const.CODE2006.toString()).post()
52 46
                     }
53
-                    666->{
47
+
48
+                    666 -> {
54 49
                         //消息确认回发mid 消息id
50
+
55 51
                     }
56
-                    999->{
52
+
53
+                    999 -> {
57 54
                         //错误消息 body msg(错误消息)
58 55
                     }
56
+
59 57
                     else -> {
60 58
                         //Log.d("message解析", socketData .message!!)
61 59
                     }

Loading…
Cancel
Save