Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mengmeng
pension
Commits
4f9f73d8
Commit
4f9f73d8
authored
Mar 12, 2021
by
mlchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加微信消息模板推送
parent
e60bcc72
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
WechatAccountConfig.java
...api/src/main/java/io/hmit/config/WechatAccountConfig.java
+2
-0
PushMessageImpl.java
...i/src/main/java/io/hmit/service/impl/PushMessageImpl.java
+6
-1
application.yml
hmit-api/src/main/resources/application.yml
+2
-1
No files found.
hmit-api/src/main/java/io/hmit/config/WechatAccountConfig.java
View file @
4f9f73d8
...
@@ -19,4 +19,6 @@ public class WechatAccountConfig {
...
@@ -19,4 +19,6 @@ public class WechatAccountConfig {
private
String
mpAppSecret
;
private
String
mpAppSecret
;
private
String
templateId
;
}
}
hmit-api/src/main/java/io/hmit/service/impl/PushMessageImpl.java
View file @
4f9f73d8
package
io
.
hmit
.
service
.
impl
;
package
io
.
hmit
.
service
.
impl
;
import
io.hmit.config.WeChatMpConfig
;
import
io.hmit.config.WechatAccountConfig
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.service.PushMessage
;
import
io.hmit.service.PushMessage
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -27,10 +29,13 @@ public class PushMessageImpl implements PushMessage {
...
@@ -27,10 +29,13 @@ public class PushMessageImpl implements PushMessage {
@Autowired
@Autowired
private
WxMpService
wxMpService
;
private
WxMpService
wxMpService
;
@Autowired
private
WechatAccountConfig
wechatAccountConfig
;
@Override
@Override
public
void
sendMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
openId
)
{
public
void
sendMsg
(
PensionOrderDTO
pensionOrderDTO
,
String
openId
)
{
WxMpTemplateMessage
templateMessage
=
new
WxMpTemplateMessage
();
WxMpTemplateMessage
templateMessage
=
new
WxMpTemplateMessage
();
templateMessage
.
setTemplateId
(
"GsGydVGl-vzOv5aA0LaIdA-FcMM88TEpe37U-lZ6HJ8"
);
templateMessage
.
setTemplateId
(
wechatAccountConfig
.
getTemplateId
()
);
templateMessage
.
setToUser
(
openId
);
templateMessage
.
setToUser
(
openId
);
List
<
WxMpTemplateData
>
data
=
Arrays
.
asList
(
List
<
WxMpTemplateData
>
data
=
Arrays
.
asList
(
...
...
hmit-api/src/main/resources/application.yml
View file @
4f9f73d8
...
@@ -76,4 +76,5 @@ QR:
...
@@ -76,4 +76,5 @@ QR:
wechat
:
wechat
:
mpAppId
:
wxfa2386639794d998
mpAppId
:
wxfa2386639794d998
mpAppSecret
:
8f624f83c9585baa9d1697e24fdffd81
mpAppSecret
:
8f624f83c9585baa9d1697e24fdffd81
\ No newline at end of file
templateId
:
GsGydVGl-vzOv5aA0LaIdA-FcMM88TEpe37U-lZ6HJ8
\ No newline at end of file
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