Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dmhub-plugin
Project
Project
Details
Activity
Releases
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
qinxunjia
dmhub-plugin
Commits
5e15acc3
Commit
5e15acc3
authored
Jul 06, 2020
by
qinxunjia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板审核通知接口
parent
3589f5f1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
6 deletions
+67
-6
BgyApi.java
src/main/java/com/bgy/sms/channel/api/BgyApi.java
+8
-5
TemplateNotify.java
...main/java/com/bgy/sms/channel/bgy/dto/TemplateNotify.java
+43
-0
BgySmsService.java
...n/java/com/bgy/sms/channel/bgy/service/BgySmsService.java
+2
-0
BgySmsServiceImpl.java
...m/bgy/sms/channel/bgy/service/impl/BgySmsServiceImpl.java
+11
-0
MessageServiceImpl.java
...ain/java/com/bgy/sms/service/impl/MessageServiceImpl.java
+3
-1
No files found.
src/main/java/com/bgy/sms/channel/api/BgyApi.java
View file @
5e15acc3
...
...
@@ -2,7 +2,7 @@ package com.bgy.sms.channel.api;
import
com.alibaba.fastjson.JSONObject
;
import
com.bgy.sms.channel.bgy.dto.
CLNotifyRequest
;
import
com.bgy.sms.channel.bgy.dto.
TemplateNotify
;
import
com.bgy.sms.channel.bgy.dto.ReportDto
;
import
com.bgy.sms.channel.bgy.service.BgySmsService
;
import
org.slf4j.Logger
;
...
...
@@ -16,12 +16,15 @@ public class BgyApi {
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
BgyApi
.
class
);
@PostMapping
(
"/notify"
)
public
String
notify
(
@RequestParam
CLNotifyRequest
notifyInfo
)
{
log
.
info
(
"碧桂园异步通知接口入参:{}"
,
JSONObject
.
toJSONString
(
notifyInfo
));
@Autowired
private
BgySmsService
bgySmsService
;
@PostMapping
(
"/templateNotify"
)
public
String
notify
(
@RequestBody
TemplateNotify
templateNotify
)
{
log
.
info
(
"碧桂园异步通知接口入参:{}"
,
JSONObject
.
toJSONString
(
templateNotify
));
String
response
=
"success"
;
try
{
// bgySmsService.asyncNotify(notifyInfo
);
bgySmsService
.
asyncNotify
(
templateNotify
);
}
catch
(
Exception
e
)
{
log
.
error
(
"处理创建模板异步通知异常:"
,
e
);
response
=
"fail"
;
...
...
src/main/java/com/bgy/sms/channel/bgy/dto/
CLNotifyRequest
.java
→
src/main/java/com/bgy/sms/channel/bgy/dto/
TemplateNotify
.java
View file @
5e15acc3
...
...
@@ -3,63 +3,26 @@ package com.bgy.sms.channel.bgy.dto;
import
java.io.Serializable
;
public
class
CLNotifyRequest
implements
Serializable
{
public
class
TemplateNotify
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
// 接口用户名
private
String
username
;
// 十位时间戳
private
String
timestamp
;
// 签名串
private
String
signature
;
// 模块
private
String
action
;
// 模板id
private
String
id
;
// 模板流水号
private
String
data
;
// 审核状态(模板(1审核,2驳回),签名(2通过,3驳回))
private
String
auditStatus
;
// 驳回原因
private
String
auditReason
;
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
String
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
String
getSignature
()
{
return
signature
;
}
public
void
setSignature
(
String
signature
)
{
this
.
signature
=
signature
;
}
public
String
getAction
()
{
return
action
;
}
public
void
setAction
(
String
action
)
{
this
.
action
=
action
;
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
String
get
Id
()
{
return
id
;
public
String
get
Data
()
{
return
data
;
}
public
void
set
Id
(
String
id
)
{
this
.
id
=
id
;
public
void
set
Data
(
String
data
)
{
this
.
data
=
data
;
}
public
String
getAuditStatus
()
{
...
...
src/main/java/com/bgy/sms/channel/bgy/service/BgySmsService.java
View file @
5e15acc3
package
com
.
bgy
.
sms
.
channel
.
bgy
.
service
;
import
com.bgy.sms.channel.bgy.dto.CLBizResponse
;
import
com.bgy.sms.channel.bgy.dto.TemplateNotify
;
public
interface
BgySmsService
{
...
...
@@ -8,4 +9,5 @@ public interface BgySmsService {
CLBizResponse
sendSms
(
String
mobile
,
String
content
,
String
areaId
)
throws
Exception
;
void
asyncNotify
(
TemplateNotify
templateNotify
);
}
src/main/java/com/bgy/sms/channel/bgy/service/impl/BgySmsServiceImpl.java
View file @
5e15acc3
...
...
@@ -4,6 +4,7 @@ package com.bgy.sms.channel.bgy.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.bgy.sms.channel.bgy.config.BgySMSConfig
;
import
com.bgy.sms.channel.bgy.dto.CLBizResponse
;
import
com.bgy.sms.channel.bgy.dto.TemplateNotify
;
import
com.bgy.sms.channel.bgy.service.BgySmsService
;
import
com.bgy.sms.channel.bgy.utils.SendSmsUtil
;
import
com.bgy.sms.channel.dmHub.service.DmHubService
;
...
...
@@ -73,4 +74,14 @@ public class BgySmsServiceImpl implements BgySmsService {
}
}
/**
* 处理短信模板的通知
*
* @param templateNotify
*/
@Override
public
void
asyncNotify
(
TemplateNotify
templateNotify
)
{
}
}
src/main/java/com/bgy/sms/service/impl/MessageServiceImpl.java
View file @
5e15acc3
...
...
@@ -89,6 +89,8 @@ public class MessageServiceImpl implements MessageService {
info
.
setUpContent
(
chuanglanSend
);
info
.
setParams
(
params
);
boolean
insert
=
smsTemplateService
.
insert
(
info
);
if
(!
insert
)
{
log
.
error
(
"模板插入DB异常:【{}】"
,
JSONObject
.
toJSONString
(
info
));
return
new
DmHubResponse
(
ResponseCode
.
SYSTEM_ERROR
);
...
...
@@ -299,7 +301,7 @@ public class MessageServiceImpl implements MessageService {
*/
private
String
getMsg
(
String
upContent
,
List
<
String
>
params
)
{
for
(
String
info
:
params
)
{
upContent
=
upContent
.
replaceFirst
(
"\\
{\\$var\\}
"
,
info
);
upContent
=
upContent
.
replaceFirst
(
"\\
$v\\$
"
,
info
);
}
return
upContent
;
}
...
...
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