Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend-java
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
other-project
backend-java
Commits
9bf0ed11
Commit
9bf0ed11
authored
Feb 07, 2020
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试回复消息
parent
c05885bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
5 deletions
+48
-5
MsgHandler.java
src/main/java/com/qkdata/biz/wx/handler/MsgHandler.java
+15
-3
application-dev.yml
src/main/resources/application-dev.yml
+9
-2
application-jxkj.yml
src/main/resources/application-jxkj.yml
+24
-0
No files found.
src/main/java/com/qkdata/biz/wx/handler/MsgHandler.java
View file @
9bf0ed11
...
...
@@ -34,10 +34,22 @@ public class MsgHandler extends AbstractHandler {
//TODO 可以选择将消息保存到本地
}
String
nickName
=
getNickNameByOpenId
(
wxMessage
.
getFromUser
(),
weixinService
);
try
{
return
new
TextBuilder
().
build
(
"您好,"
+
nickName
+
",欢迎关注本公众号。"
,
wxMessage
,
weixinService
);
try
{
String
nickName
=
getNickNameByOpenId
(
wxMessage
.
getFromUser
(),
weixinService
);
String
content
=
"您咨询的问题是:"
;
if
(
wxMessage
.
getMsgType
().
equals
(
"text"
)){
content
+=
wxMessage
.
getContent
();
}
else
if
(
wxMessage
.
getMsgType
().
equals
(
"voice"
)){
content
+=
wxMessage
.
getRecognition
();
}
else
if
(
wxMessage
.
getMsgType
().
equals
(
"image"
)
||
wxMessage
.
getMsgType
().
equals
(
"video"
)
||
wxMessage
.
getMsgType
().
equals
(
"shortvideo"
)
||
wxMessage
.
getMsgType
().
equals
(
"location"
)
||
wxMessage
.
getMsgType
().
equals
(
"link"
)){
content
=
"对不起,暂不支持该类消息"
;
}
return
new
TextBuilder
().
build
(
"您好,"
+
nickName
+
","
+
content
,
wxMessage
,
weixinService
);
}
catch
(
Exception
e
)
{
WxMpXmlOutTextMessage
m
=
WxMpXmlOutMessage
.
TEXT
().
content
(
e
.
getMessage
())
.
fromUser
(
wxMessage
.
getToUser
()).
toUser
(
wxMessage
.
getFromUser
())
...
...
src/main/resources/application-dev.yml
View file @
9bf0ed11
server
:
port
:
80
80
port
:
80
spring
:
...
...
@@ -14,4 +14,11 @@ spring:
log
:
path
:
../data/logs
wx
:
mp
:
configs
:
-
appid
:
wxea78b5b73ce4e861
secret
:
a7fcec7f9291e631de9d7547b43d2934
token
:
jingxiang
aesKey
:
templateId
:
h7BghfwRb7P-2FeR8qbeS5c2EGQqA6fXO_I9FpwFGi8
src/main/resources/application-jxkj.yml
0 → 100644
View file @
9bf0ed11
server
:
port
:
80
spring
:
datasource
:
druid
:
url
:
jdbc:mysql://localhost:3306/framework?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&useSSL=false
username
:
root
password
:
123456
# redis:
# host: localhost
log
:
path
:
../data/logs
wx
:
mp
:
configs
:
-
appid
:
wxe97fd2b45e0951b3
secret
:
b0b25c67b35f05c949fa04ef9cd07c48
token
:
jingxiang
aesKey
:
templateId
:
h7BghfwRb7P-2FeR8qbeS5c2EGQqA6fXO_I9FpwFGi8
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