Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
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
Administrator
browser-backend
Commits
4d090d85
Commit
4d090d85
authored
Apr 11, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册用户发短信
parent
25401d34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
1 deletion
+33
-1
AdministratorController.java
...erbackend/account/controller/AdministratorController.java
+1
-1
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+8
-0
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+1
-0
SmsUtils.java
...m/edgec/browserbackend/common/commons/utils/SmsUtils.java
+23
-0
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AdministratorController.java
View file @
4d090d85
...
...
@@ -332,7 +332,7 @@ public class AdministratorController {
return
resultDto
;
}
//
获取
用户企业认证的信息
//
设置
用户企业认证的信息
@PreAuthorize
(
Securitys
.
ADMIN_EL
)
@RequestMapping
(
path
=
"/0xadministrator/authorize/set"
,
method
=
RequestMethod
.
PUT
)
public
ResultDto
setAuthorize
(
Principal
principal
,
@RequestParam
(
"username"
)
String
username
,
@RequestParam
(
"isAgree"
)
boolean
isAgree
)
{
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
4d090d85
...
...
@@ -522,6 +522,14 @@ public class AccountServiceImpl implements AccountService {
userAuthService
.
create
(
new
com
.
edgec
.
browserbackend
.
auth
.
domain
.
User
(
user
));
repository
.
save
(
account
);
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"newuser"
,
account
.
getName
());
if
(
inviter
!=
null
)
param
.
put
(
"referral"
,
inviter
.
getName
()
+
"("
+
user
.
getPromotionCode
()
+
")"
);
else
param
.
put
(
"referral"
,
""
);
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"15919921106"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
if
(
inviter
!=
null
)
{
paymentService
.
bankTransferInsertion
(
account
.
getName
(),
12
);
}
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
4d090d85
...
...
@@ -394,6 +394,7 @@ public class AdministratorServiceImpl implements AdministratorService {
Promotion
promotion
=
new
Promotion
();
accounts
.
forEach
(
x
->
{
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
x
.
getPromotion
().
getTotalCommission
());
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
promotion
.
setWithdrawn
(
promotion
.
getWithdrawn
()
+
x
.
getPromotion
().
getWithdrawn
());
...
...
src/main/java/com/edgec/browserbackend/common/commons/utils/SmsUtils.java
View file @
4d090d85
...
...
@@ -28,6 +28,7 @@ public class SmsUtils {
AUTHCODE
(
"SMS_185841618"
),
IPWILLEXPIRE_EXPIRE
(
"SMS_185821567"
),
IPEXPIRED
(
"SMS_185841667"
),
NEWACCOUNT
(
"SMS_187750800"
);
;
...
...
@@ -90,6 +91,28 @@ public class SmsUtils {
// }
// }
public
static
void
sendNewAccountSms
(
String
phoneNum
,
SmsTemplateCode
smsTemplateCode
,
JSONObject
param
)
{
CommonRequest
request
=
new
CommonRequest
();
//request.setProtocol(ProtocolType.HTTPS);
request
.
setMethod
(
MethodType
.
POST
);
request
.
setDomain
(
"dysmsapi.aliyuncs.com"
);
request
.
setVersion
(
"2017-05-25"
);
request
.
setAction
(
"SendSms"
);
request
.
putQueryParameter
(
"PhoneNumbers"
,
phoneNum
);
request
.
putQueryParameter
(
"SignName"
,
"防关联浏览器"
);
request
.
putQueryParameter
(
"TemplateCode"
,
smsTemplateCode
.
getCode
());
request
.
putQueryParameter
(
"TemplateParam"
,
param
.
toJSONString
());
try
{
CommonResponse
response
=
iAcsClient
.
getCommonResponse
(
request
);
if
(
response
.
getHttpStatus
()
==
200
&&
response
.
getData
().
contains
(
"OK"
))
{
return
;
}
else
{
log
.
error
(
"Send SMS Error,{}, {}, {}, {}"
,
phoneNum
,
smsTemplateCode
,
param
,
response
.
getData
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"Send SMS Error,{}, {}, {}"
,
phoneNum
,
smsTemplateCode
,
param
);
}
}
public
static
void
sendIpSms
(
String
phoneNum
,
SmsTemplateCode
smsTemplateCode
,
JSONObject
param
)
{
CommonRequest
request
=
new
CommonRequest
();
...
...
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