Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-wx-store-sharer
Overview
Overview
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
wx
yanxuan-wx-store-sharer
Commits
90ed7c9f
Commit
90ed7c9f
authored
May 15, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推客分佣单阿波罗配置调整
parent
f47ed44b
Pipeline
#75525
passed with stages
in 1 minute 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
SmsServiceImpl.java
...xuan/wx/store/sharer/biz/service/impl/SmsServiceImpl.java
+8
-4
IUasClient.java
...anxuan/wx/store/sharer/integration/client/IUasClient.java
+4
-1
UasClientImpl.java
...x/store/sharer/integration/client/impl/UasClientImpl.java
+7
-7
No files found.
yanxuan-wx-store-sharer-biz/src/main/java/com/netease/yanxuan/wx/store/sharer/biz/service/impl/SmsServiceImpl.java
View file @
90ed7c9f
...
...
@@ -71,16 +71,20 @@ public class SmsServiceImpl implements ISmsService {
*/
private
Boolean
sendCode
(
String
scenes
,
String
mobilePhone
)
{
log
.
error
(
"[op:sendSmsCode] sendCode..."
);
SmsCodeScenesConfigBO
scenesConfigBO
=
smsConfig
.
getScenesConfig
(
scenes
);
if
(
null
==
scenesConfigBO
){
throw
new
BizException
(
"短信配置错误"
);
}
// 生成6位随机数字
String
code
=
RandomUtils
.
randomNumber
(
6
);
// uas发送验证码
boolean
success
=
iUasClient
.
sendSmsCode
(
LoginUserContextHolder
.
get
().
getOpenId
(),
mobilePhone
,
code
,
scenes
);
boolean
success
=
iUasClient
.
sendSmsCode
(
LoginUserContextHolder
.
get
().
getOpenId
(),
mobilePhone
,
code
,
scenes
,
scenesConfigBO
);
if
(!
success
)
{
return
false
;
}
SmsCodeScenesConfigBO
smsCodeScenesConfigBO
=
smsConfig
.
getScenesConfig
(
scenes
);
int
sendIntervalSeconds
=
smsCodeScenesConfigBO
.
getSendIntervalSeconds
();
int
codeValidMinutes
=
smsCodeScenesConfigBO
.
getCodeValidMinutes
();
int
sendIntervalSeconds
=
scenesConfigBO
.
getSendIntervalSeconds
();
int
codeValidMinutes
=
scenesConfigBO
.
getCodeValidMinutes
();
// 标记验证码已发送
String
sendCodeKey
=
String
.
format
(
SmsConstant
.
SMS_SEND_INTERVAL_KEY
,
scenes
,
mobilePhone
);
redisClient
.
setStr
(
sendCodeKey
,
String
.
valueOf
(
System
.
currentTimeMillis
()),
sendIntervalSeconds
);
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/client/IUasClient.java
View file @
90ed7c9f
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
integration
.
client
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SmsCodeScenesConfigBO
;
/**
* @Description Uas服务
* @Author fanjiaxin
...
...
@@ -10,5 +12,6 @@ public interface IUasClient {
/**
* 发送短信
*/
boolean
sendSmsCode
(
String
uid
,
String
phone
,
String
code
,
String
scenes
);
boolean
sendSmsCode
(
String
uid
,
String
phone
,
String
code
,
String
scenes
,
SmsCodeScenesConfigBO
scenesConfigBO
);
}
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/client/impl/UasClientImpl.java
View file @
90ed7c9f
...
...
@@ -9,7 +9,6 @@ package com.netease.yanxuan.wx.store.sharer.integration.client.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.netease.yanxuan.wx.store.sharer.integration.client.IUasClient
;
import
com.netease.yanxuan.wx.store.sharer.integration.config.RpcConfig
;
import
com.netease.yanxuan.wx.store.sharer.integration.config.SmsConfig
;
import
com.netease.yanxuan.wx.store.sharer.integration.handler.RestTemplateHandler
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SmsCodeScenesConfigBO
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -26,7 +25,6 @@ import java.util.Map;
@Service
public
class
UasClientImpl
implements
IUasClient
{
private
final
SmsConfig
smsConfig
;
private
final
RpcConfig
rpcConfig
;
private
final
RestTemplateHandler
restTemplateHandler
;
...
...
@@ -44,8 +42,9 @@ public class UasClientImpl implements IUasClient {
* @return
*/
@Override
public
boolean
sendSmsCode
(
String
uid
,
String
phone
,
String
code
,
String
scenes
)
{
Map
<
String
,
Object
>
params
=
assembleSmsArg
(
uid
,
phone
,
code
,
scenes
);
public
boolean
sendSmsCode
(
String
uid
,
String
phone
,
String
code
,
String
scenes
,
SmsCodeScenesConfigBO
scenesConfigBO
)
{
Map
<
String
,
Object
>
params
=
assembleSmsArg
(
uid
,
phone
,
code
,
scenes
,
scenesConfigBO
);
String
httpUrl
=
rpcConfig
.
getUasUrl
()
+
SMS_SEND_PATH
+
PRODUCT
;
try
{
JSONObject
rpcResult
=
restTemplateHandler
.
execute
(
httpUrl
,
HttpMethod
.
POST
,
params
,
JSONObject
.
class
);
...
...
@@ -57,11 +56,12 @@ public class UasClientImpl implements IUasClient {
}
private
Map
<
String
,
Object
>
assembleSmsArg
(
String
uid
,
String
phone
,
String
code
,
String
scenes
)
{
private
Map
<
String
,
Object
>
assembleSmsArg
(
String
uid
,
String
phone
,
String
code
,
String
scenes
,
SmsCodeScenesConfigBO
scenesConfigBO
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"phone"
,
phone
);
SmsCodeScenesConfigBO
scenesConfig
=
smsConfig
.
getScenesConfig
(
scenes
);
params
.
put
(
"message"
,
String
.
format
(
scenesConfig
.
getMessageFormat
(),
code
,
scenesConfig
.
getCodeValidMinutes
()));
params
.
put
(
"message"
,
String
.
format
(
scenesConfigBO
.
getMessageFormat
(),
code
,
scenesConfigBO
.
getCodeValidMinutes
()));
params
.
put
(
"level"
,
1
);
params
.
put
(
"uid"
,
uid
);
params
.
put
(
"topic"
,
String
.
format
(
TOPIC_FORMAT
,
scenes
));
...
...
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