Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
ea3f94d0
Commit
ea3f94d0
authored
Jun 04, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
d0adcdd0
19805785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
ConfigFeign.java
...rc/main/java/com/xxfc/platform/app/feign/ConfigFeign.java
+1
-1
SmsService.java
.../java/com/xxfc/platform/universal/service/SmsService.java
+6
-2
No files found.
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/feign/ConfigFeign.java
View file @
ea3f94d0
...
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
//@FeignClient(value = "${auth.serviceId}",configuration = {})
//@FeignClient(value = "${auth.serviceId}",configuration = {})
@FeignClient
(
"xx-app"
)
@FeignClient
(
"xx-app"
)
public
interface
ConfigFeign
{
public
interface
ConfigFeign
{
@RequestMapping
(
value
=
"/cofig/
types/{types}
"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/cofig/
app/unauth/types
"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
Cofig
>
getAllByType
(
String
types
);
public
ObjectRestResponse
<
Cofig
>
getAllByType
(
String
types
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/SmsService.java
View file @
ea3f94d0
...
@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.RandomUtil;
...
@@ -21,6 +21,7 @@ import com.github.wxiaoqi.security.common.util.RandomUtil;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -45,6 +46,9 @@ public class SmsService {
...
@@ -45,6 +46,9 @@ public class SmsService {
public
JSONObject
smsCode
(
String
mobile
){
public
JSONObject
smsCode
(
String
mobile
){
String
code
=
RandomUtil
.
getRandomStr
(
6
);
// 6位短信验证码
String
code
=
RandomUtil
.
getRandomStr
(
6
);
// 6位短信验证码
try
{
try
{
if
(
StringUtils
.
isNotBlank
(
mobile
)){
mobile
=
mobile
.
replace
(
" "
,
""
);
}
code
=
sendSms
(
mobile
,
code
);
code
=
sendSms
(
mobile
,
code
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
code
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
code
);
}
catch
(
ClientException
e
)
{
}
catch
(
ClientException
e
)
{
...
@@ -83,7 +87,7 @@ public class SmsService {
...
@@ -83,7 +87,7 @@ public class SmsService {
//request.setOutId("yourOutId");
//request.setOutId("yourOutId");
//hint 此处可能会抛出异常,注意catch
//hint 此处可能会抛出异常,注意catch
SendSmsResponse
sendSmsResponse
=
acsClient
.
getAcsResponse
(
request
);
SendSmsResponse
sendSmsResponse
=
acsClient
.
getAcsResponse
(
request
);
log
.
info
(
"短信接口返回的数据----------------
"
);
log
.
info
(
"短信接口返回的数据----------------
mobile======"
+
mobile
+
"----code===="
+
code
);
log
.
info
(
"Code="
+
sendSmsResponse
.
getCode
());
log
.
info
(
"Code="
+
sendSmsResponse
.
getCode
());
log
.
info
(
"Message="
+
sendSmsResponse
.
getMessage
());
log
.
info
(
"Message="
+
sendSmsResponse
.
getMessage
());
log
.
info
(
"RequestId="
+
sendSmsResponse
.
getRequestId
());
log
.
info
(
"RequestId="
+
sendSmsResponse
.
getRequestId
());
...
@@ -131,7 +135,7 @@ public class SmsService {
...
@@ -131,7 +135,7 @@ public class SmsService {
public
static
void
main
(
String
[]
args
)
throws
ClientException
,
InterruptedException
{
public
static
void
main
(
String
[]
args
)
throws
ClientException
,
InterruptedException
{
SmsService
SmsService
=
new
SmsService
();
SmsService
SmsService
=
new
SmsService
();
//发短信
//发短信
String
response
=
SmsService
.
sendSms
(
"1
3612688539
"
,
"123456"
);
String
response
=
SmsService
.
sendSms
(
"1
5521075918
"
,
"123456"
);
/*System.out.println("短信接口返回的数据----------------");
/*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());
System.out.println("Code=" + response.getCode());
System.out.println("Message=" + response.getMessage());
System.out.println("Message=" + response.getMessage());
...
...
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