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
efcef36e
Commit
efcef36e
authored
May 15, 2025
by
fanjiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推客分佣单阿波罗配置调整
parent
7bd0d4fb
Pipeline
#75530
passed with stages
in 1 minute 10 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
20 deletions
+23
-20
UasClientImpl.java
...x/store/sharer/integration/client/impl/UasClientImpl.java
+6
-14
RpcConfig.java
...yanxuan/wx/store/sharer/integration/config/RpcConfig.java
+1
-6
UasFacade.java
...yanxuan/wx/store/sharer/integration/facade/UasFacade.java
+16
-0
No files found.
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/client/impl/UasClientImpl.java
View file @
efcef36e
...
...
@@ -9,14 +9,12 @@ package com.netease.yanxuan.wx.store.sharer.integration.client.impl;
import
com.alibaba.fastjson.JSON
;
import
com.netease.yanxuan.wx.store.sharer.common.exception.BizException
;
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.handler.RestTemplateHandler
;
import
com.netease.yanxuan.wx.store.sharer.integration.facade.UasFacade
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SendSmsCodeBO
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SmsCodeScenesConfigBO
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
...
...
@@ -29,12 +27,8 @@ import java.util.Map;
@Service
public
class
UasClientImpl
implements
IUasClient
{
private
final
RpcConfig
rpcConfig
;
private
final
RestTemplateHandler
restTemplateHandler
;
private
final
UasFacade
uasFacade
;
private
static
final
String
PRODUCT
=
"yanxuan-wx-store-sharer"
;
private
static
final
String
SMS_SEND_PATH
=
"/push/sms/"
;
private
static
final
String
TOPIC_FORMAT
=
"verify_%s"
;
/**
...
...
@@ -50,18 +44,16 @@ public class UasClientImpl implements IUasClient {
String
scenes
,
SmsCodeScenesConfigBO
scenesConfigBO
)
{
Map
<
String
,
Object
>
params
=
assembleSmsArg
(
uid
,
phone
,
code
,
scenes
,
scenesConfigBO
);
log
.
error
(
"[op:UasClientImpl:sendSmsCode] params:{}"
,
JSON
.
toJSONString
(
params
));
String
httpUrl
=
rpcConfig
.
getUasUrl
()
+
SMS_SEND_PATH
+
PRODUCT
;
try
{
log
.
error
(
"[op:UasClientImpl:sendSmsCode] httpUrl:{}"
,
httpUrl
);
SendSmsCodeBO
rpcResult
=
restTemplateHandler
.
execute
(
httpUrl
,
HttpMethod
.
POST
,
params
,
SendSmsCodeBO
.
class
);
SendSmsCodeBO
rpcResult
=
uasFacade
.
pushSmsCode
(
params
);
log
.
error
(
"[op:UasClientImpl:sendSmsCode] rpcResult:{}"
,
JSON
.
toJSONString
(
rpcResult
));
if
(
null
==
rpcResult
)
{
if
(
null
==
rpcResult
)
{
return
false
;
}
if
(
HttpStatus
.
OK
.
value
()
==
rpcResult
.
getCode
())
{
if
(
HttpStatus
.
OK
.
value
()
==
rpcResult
.
getCode
())
{
return
true
;
}
if
(
StringUtils
.
isNotBlank
(
rpcResult
.
getErrorCode
()))
{
if
(
StringUtils
.
isNotBlank
(
rpcResult
.
getErrorCode
()))
{
throw
new
BizException
(
rpcResult
.
getErrorCode
());
}
}
catch
(
Exception
e
)
{
...
...
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/config/RpcConfig.java
View file @
efcef36e
...
...
@@ -2,16 +2,11 @@ package com.netease.yanxuan.wx.store.sharer.integration.config;
import
com.ctrip.framework.apollo.spring.annotation.EnableAutoUpdateApolloConfig
;
import
lombok.Getter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Getter
@Component
@EnableAutoUpdateApolloConfig
(
"rpc.config"
)
public
class
RpcConfig
{
/**
* uas地址
*/
@Value
(
"${uas.url:http://127.0.0.1:8550/proxy/test.logistics-uas.service.mailsaas}"
)
private
String
uasUrl
;
}
yanxuan-wx-store-sharer-integration/src/main/java/com/netease/yanxuan/wx/store/sharer/integration/facade/UasFacade.java
0 → 100644
View file @
efcef36e
package
com
.
netease
.
yanxuan
.
wx
.
store
.
sharer
.
integration
.
facade
;
import
com.netease.yanxuan.missa.client.annotation.MissaClient
;
import
com.netease.yanxuan.wx.store.sharer.integration.meta.model.bo.SendSmsCodeBO
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
java.util.Map
;
@MissaClient
(
serviceCode
=
"logistics-uas"
)
public
interface
UasFacade
{
@RequestMapping
(
value
=
"/push/sms/yanxuan-wx-store-sharer"
,
method
=
RequestMethod
.
POST
)
SendSmsCodeBO
pushSmsCode
(
@RequestBody
Map
<
String
,
Object
>
param
);
}
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