Commit 4c107050 by zhouhaibao

feat(merchant): 添加商户详情接口下线开关控制

- 通过环境变量 db.nosession.flag 控制接口是否下线
- 当配置项为空时返回"当前接口已下线"错误响应
- 无需代码修改即可通过配置切换接口上下线状态
1 parent e83b0e19
...@@ -48,6 +48,10 @@ public class MerchantController { ...@@ -48,6 +48,10 @@ public class MerchantController {
@ServiceMethod(method="scrm.api.equity.common.merchant.detail.det", needInSession= NeedInSessionType.NO) @ServiceMethod(method="scrm.api.equity.common.merchant.detail.det", needInSession= NeedInSessionType.NO)
@ApiOperation("获取商户详情") @ApiOperation("获取商户详情")
public RopResponse<MerchantRopResponse> getMerchantDetail(OpenCardByMerchantIdRequest ropRequest) throws UnsupportedEncodingException { public RopResponse<MerchantRopResponse> getMerchantDetail(OpenCardByMerchantIdRequest ropRequest) throws UnsupportedEncodingException {
String property = env.getProperty("db.nosession.flag");
if (StringUtils.isEmpty(property)){
return RopResponse.error("当前接口已下线");
}
RpcResponse<MerchantRopResponse> rpcResponse1 = merchantRemote.getByMerchantId(ropRequest.getMerchantId()); RpcResponse<MerchantRopResponse> rpcResponse1 = merchantRemote.getByMerchantId(ropRequest.getMerchantId());
if (rpcResponse1.isSuccess() && rpcResponse1.getResult() != null){ if (rpcResponse1.isSuccess() && rpcResponse1.getResult() != null){
return RopResponse.success(rpcResponse1.getResult()); return RopResponse.success(rpcResponse1.getResult());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!