Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
f65be0ae
Commit
f65be0ae
authored
Apr 26, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志打印
parent
755ec6ea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
core/src/main/java/com/wecloud/dispatch/general/GeneralMessageHandler.java
+19
-0
core/src/main/java/com/wecloud/utils/JsonUtils.java
+1
-1
No files found.
core/src/main/java/com/wecloud/dispatch/general/GeneralMessageHandler.java
View file @
f65be0ae
package
com
.
wecloud
.
dispatch
.
general
;
package
com
.
wecloud
.
dispatch
.
general
;
import
com.alibaba.fastjson.JSON
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.exception.BusinessException
;
import
io.geekidea.springbootplus.framework.common.exception.BusinessException
;
import
io.geekidea.springbootplus.framework.common.exception.DaoException
;
import
io.geekidea.springbootplus.framework.common.exception.DaoException
;
...
@@ -105,4 +106,22 @@ public class GeneralMessageHandler {
...
@@ -105,4 +106,22 @@ public class GeneralMessageHandler {
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
am
.
getSenderChannel
(),
res
);
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
am
.
getSenderChannel
(),
res
);
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
String
str
=
"{\"conversationId\":1518190080274190336,\"attributes\":\"{\\\"count\\\":1}\"}"
;
// 解析jsonO
BaseRequest
baseRequest
=
JsonUtils
.
decodeJson
(
str
,
BaseRequest
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
baseRequest
));
}
}
}
core/src/main/java/com/wecloud/utils/JsonUtils.java
View file @
f65be0ae
...
@@ -44,7 +44,7 @@ public class JsonUtils {
...
@@ -44,7 +44,7 @@ public class JsonUtils {
try
{
try
{
return
OBJECT_MAPPER
.
readValue
(
strJsonBody
,
c
);
return
OBJECT_MAPPER
.
readValue
(
strJsonBody
,
c
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
warn
(
"解析json字符串失败,原字符串: {}"
,
strJsonBody
);
log
.
warn
(
"解析json字符串失败,原字符串: {}"
,
strJsonBody
,
e
);
return
null
;
return
null
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment