Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-support-rlwx
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
rl
hls-support-rlwx
Commits
0180ca87
Commit
0180ca87
authored
Jun 13, 2023
by
宋勇健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信接口
parent
f547629e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
HclcSmsController.java
.../java/com/hand/app/sms/controllers/HclcSmsController.java
+1
-2
HclcSmsServiceImpl.java
...ava/com/hand/app/sms/service/impl/HclcSmsServiceImpl.java
+4
-6
No files found.
core/src/main/java/com/hand/app/sms/controllers/HclcSmsController.java
View file @
0180ca87
...
...
@@ -29,9 +29,8 @@ public class HclcSmsController extends BaseController {
@ResponseBody
@RequestMapping
(
"/api/public/send/sms"
)
public
JSONObject
sendSms
(
HttpServletRequest
request
,
@RequestBody
(
required
=
true
)
JSONObject
params
)
{
JSONObject
json
=
new
JSONObject
();
IRequest
iRequest
=
createRequestContext
(
request
);
json
=
hclcSmsService
.
sendSms
(
iRequest
,
params
);
JSONObject
json
=
hclcSmsService
.
sendSms
(
iRequest
,
params
);
return
json
;
}
}
core/src/main/java/com/hand/app/sms/service/impl/HclcSmsServiceImpl.java
View file @
0180ca87
...
...
@@ -19,7 +19,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
...
...
@@ -79,7 +78,7 @@ public class HclcSmsServiceImpl implements IHclcSmsService {
@Override
public
JSONObject
sendSms
(
IRequest
iRequest
,
JSONObject
params
)
{
logger
.
info
(
"=============start se
t
Sms=================="
);
logger
.
info
(
"=============start se
nd
Sms=================="
);
JSONObject
result
=
new
JSONObject
();
//appId && secretKey 通过社内 传入,以后修改的时候 只需要修改 pkg 就可以 不用修改java代码重启
...
...
@@ -131,17 +130,16 @@ public class HclcSmsServiceImpl implements IHclcSmsService {
logger
.
info
(
"token url: {}"
,
sendSmsApiUrl
);
if
(
sendSmsApiUrl
!=
null
)
{
String
request
=
"appId="
+
appId
+
"×tamp="
+
timestamp
+
"&sign="
+
sign
+
"&mobiles"
+
params
.
get
(
"mobiles"
).
toString
()
+
"&content="
+
params
.
get
(
"content"
).
toString
()
+
"&customSmsId="
+
params
.
get
(
"customSmsId"
).
toString
();
HlsWsRequests
log
=
hclcSmsLogService
.
createLog
(
iRequest
,
"hclc_sms"
,
sendSmsApiUrl
,
request
,
Long
.
parseLong
(
params
.
get
(
"mobiles"
).
toString
()));
setSms
(
iRequest
,
appId
,
sign
,
timestamp
,
sendSmsApiUrl
,
params
.
get
(
"content"
).
toString
(),
params
.
get
(
"mobiles"
).
toString
(),
params
.
get
(
"customSmsId"
).
toString
(),
null
,
null
,
log
);
result
=
setSms
(
iRequest
,
appId
,
sign
,
timestamp
,
sendSmsApiUrl
,
params
.
get
(
"content"
).
toString
(),
params
.
get
(
"mobiles"
).
toString
(),
params
.
get
(
"customSmsId"
).
toString
(),
null
,
null
,
log
);
}
else
{
result
.
put
(
Constants
.
RESP_CODE
,
transFail
);
result
.
put
(
"respMsg"
,
"接口平台URL未定义,请检查!"
);
return
result
;
}
logger
.
info
(
"=============end sendSms=================="
);
return
result
;
}
...
...
@@ -150,7 +148,7 @@ public class HclcSmsServiceImpl implements IHclcSmsService {
*/
private
JSONObject
setSms
(
IRequest
iRequest
,
String
appId
,
String
sign
,
String
timestamp
,
String
sendSmsApiUrl
,
String
content
,
String
mobiles
,
String
customSmsId
,
String
extendedCode
,
String
timerTime
,
HlsWsRequests
log
)
{
JSONObject
result
=
new
JSONObject
();
logger
.
info
(
"============= setSms=================="
);
logger
.
info
(
"=============
start
setSms=================="
);
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
try
{
params
.
put
(
"appId"
,
appId
);
...
...
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