Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
dd90a984
Commit
dd90a984
authored
Oct 13, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公众号
parent
b53ca1c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/OfficialAccountController.java
...in/java/com/wwdz/ch/wx/api/OfficialAccountController.java
+18
-22
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/OfficialAccountController.java
View file @
dd90a984
...
@@ -16,10 +16,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -16,10 +16,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
@RestController
@RestController
@RequestMapping
(
"/officialAccountCallback"
)
@RequestMapping
(
"/officialAccountCallback"
)
...
@@ -91,28 +88,27 @@ public class OfficialAccountController {
...
@@ -91,28 +88,27 @@ public class OfficialAccountController {
@RequestBody
(
required
=
false
)
String
xmlInfo
,
@RequestBody
(
required
=
false
)
String
xmlInfo
,
HttpServletResponse
response
)
throws
IOException
{
HttpServletResponse
response
)
throws
IOException
{
logger
.
info
(
"222222222222222 :{}"
,
echostr
);
logger
.
info
(
"222222222222222 :{}"
,
echostr
);
/*try {
System
.
out
.
println
(
"接入失败"
);
logger.info("微信通知回调接口原文:{}", xmlInfo);
return
echostr
+
""
;
List<Map<String, String>> list = XmlUtils.fromXml(xmlInfo, "xml");
}
Map<String, String> contentMap = list.get(0);
String event = contentMap.get("Event");
if (SUBSCRIBE_EVENT.equals(event) || UNSUBSCRIBE_EVENT.equals(event)) {
@RequestMapping
(
value
=
"/getSubscribeNotice2"
)
String userOpenId = contentMap.get("FromUserName");
public
Object
getSubscribeNotice2
(
@RequestParam
(
required
=
false
,
name
=
"signature"
)
String
signature
,
String createTime = contentMap.get("CreateTime");
@RequestParam
(
required
=
false
,
name
=
"timestamp"
)
String
timestamp
,
Date date = new Date(createTime);
@RequestParam
(
required
=
false
,
name
=
"nonce"
)
String
nonce
,
logger.info("openId:{}, event :{}, time:{}", userOpenId, event, date);
@RequestParam
(
required
=
false
,
name
=
"echostr"
)
String
echostr
,
}
@RequestBody
(
required
=
false
)
String
xmlInfo
,
} catch (Exception e) {
HttpServletResponse
response
)
throws
IOException
{
logger.error("视频号回调推送error : {}", e);
logger
.
info
(
"33333 :{}"
,
echostr
);
}*/
System
.
out
.
println
(
"接入失败"
);
response
.
setContentType
(
"text/plain"
);
// 设置响应的内容类型为HTML
return
Long
.
valueOf
(
echostr
);
response
.
setCharacterEncoding
(
"UTF-8"
);
// 设置响应的字符编码为UTF-8
response
.
getWriter
().
write
(
echostr
);
return
echostr
;
}
}
@RequestMapping
(
value
=
"/getToken"
)
@RequestMapping
(
value
=
"/getToken"
)
public
String
getToken
(){
public
String
getToken
(){
String
token
=
null
;
String
token
=
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