Commit 27d4fdec by 王宇航

1.8.0

增加一些日誌
parent 870e8c77
...@@ -55,7 +55,7 @@ afterEvaluate { ...@@ -55,7 +55,7 @@ afterEvaluate {
groupId = "com.gingersoft.connect" groupId = "com.gingersoft.connect"
artifactId = "Connect" artifactId = "Connect"
version = "1.7.9" version = "1.8.0"
// 添加 POM 配置 // 添加 POM 配置
// pom { // pom {
// name.set("GingerSoftConnect") // name.set("GingerSoftConnect")
......
...@@ -32,14 +32,18 @@ class MyWebSocketServer(address: InetSocketAddress) : ...@@ -32,14 +32,18 @@ class MyWebSocketServer(address: InetSocketAddress) :
// 有KDS主動獲取食品、沽清信息接口 // 有KDS主動獲取食品、沽清信息接口
// RicePOS收到KDS要獲取食品的消息後,發送本地食品信息過去 // RicePOS收到KDS要獲取食品的消息後,發送本地食品信息過去
message?.let { message?.let {
Log.e(TAG, "創建協程")
val msg = GsonUtils.GsonToBean(message, MessageBean::class.java) val msg = GsonUtils.GsonToBean(message, MessageBean::class.java)
// 创建一个协程作用域 // 创建一个协程作用域
val scope = CoroutineScope(Dispatchers.IO) val scope = CoroutineScope(Dispatchers.IO)
// 在协程作用域中异步处理消息 // 在协程作用域中异步处理消息
scope.launch { scope.launch {
Log.e(TAG, "開始處理消息")
MsgParser.process(msg)?.let { MsgParser.process(msg)?.let {
val gsonString = GsonUtils.GsonString(it)
Log.e(TAG, "處理結果:$gsonString")
// 接受到消息並處理後,將結果返回回去 // 接受到消息並處理後,將結果返回回去
conn?.send(GsonUtils.GsonString(it)) conn?.send(gsonString)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment