Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-notifycenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d2eefa86
authored
Apr 15, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
通知服务-新增发短信接口,分隔符处理
1 parent
bf62185f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
src/main/java/cn/com/glsx/notify/modules/service/SmsService.java
src/main/java/cn/com/glsx/notify/modules/service/SmsService.java
View file @
d2eefa8
...
@@ -18,7 +18,6 @@ import org.springframework.util.MultiValueMap;
...
@@ -18,7 +18,6 @@ import org.springframework.util.MultiValueMap;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.text.MessageFormat
;
import
java.text.MessageFormat
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -54,10 +53,10 @@ public class SmsService {
...
@@ -54,10 +53,10 @@ public class SmsService {
}
}
String
content
=
MessageFormat
.
format
(
mt
.
getContent
(),
arg
);
String
content
=
MessageFormat
.
format
(
mt
.
getContent
(),
arg
);
//把非英文逗号分隔符替换为英文逗号分隔符,todo 待优化,用正则统一替换非英文逗号分隔符
phone
=
phone
.
replaceAll
(
","
,
","
).
replaceAll
(
";"
,
","
).
replaceAll
(
";"
,
","
);
String
[]
phones
=
phone
.
split
(
";"
);
sendMessage
(
phone
,
mt
.
getSource
(),
String
.
valueOf
(
mt
.
getType
()),
content
);
Arrays
.
asList
(
phones
).
forEach
(
pno
->
sendMessage
(
pno
,
mt
.
getSource
(),
String
.
valueOf
(
mt
.
getType
()),
content
));
MessageLog
log
=
new
MessageLog
();
MessageLog
log
=
new
MessageLog
();
log
.
setToUser
(
phone
);
log
.
setToUser
(
phone
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment