Commit 6a40e719 by 杨卫

feat:1047852:添加远程调用配置

1 parent 241c4848
package cn.com.glsx.dj.config.dubbo;
import cn.com.glsx.dj.peanalysis.remote.BiAnalyseBackgroundRemote;
import cn.com.glsx.dj.peanalysis.remote.BusinessSceneAnalysisRemote;
import lombok.RequiredArgsConstructor;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.context.annotation.Bean;
......@@ -27,5 +28,13 @@ public class PeAnalysisDubboConfig {
.build();
}
@Bean
public BusinessSceneAnalysisRemote businessSceneAnalysisRemote(){
return factory
.builder(BusinessSceneAnalysisRemote.class)
.check(false)
.version("1.0.0")
.timeout(30000)
.build();
}
}
......@@ -39,7 +39,7 @@ public class BiMatterController {
@ApiOperation("bi事项管理-新增待跟进事项")
@ServiceMethod(method = "dj.api.pe.analysis.merchant.bi.matter.add", needInSession = NeedInSessionType.YES)
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.merchant.bi.matter.add", needInSession = NeedInSessionType.YES)
public RopResponse<Boolean> merchantBiMatterAdd(MerchantBiMatterAddReq request) {
try {
LoginUserInfoResponse loginUserDTO = Optional.ofNullable(CommonUtil.getLoginUserInfo())
......@@ -55,16 +55,16 @@ public class BiMatterController {
return RopResponse.success(response.getResult());
} catch (RpcServiceException e) {
log.info("dj.api.pe.analysis.merchant.bi.matter.add occur error!", e);
log.info("dj.api.smartcarlife.business.analysis.merchant.bi.matter.add occur error!", e);
return RopResponse.error(e);
} catch (Exception e) {
log.info("dj.api.pe.analysis.merchant.bi.matter.add occur error!", e);
log.info("dj.api.smartcarlife.business.analysis.merchant.bi.matter.add error!", e);
return RopResponse.result(DefaultErrorEnum.SERVICE_ERROR);
}
}
@ApiOperation("BI-事项管理处理")
@ServiceMethod(method = "dj.api.script.merchant.bi.matter.handle", needInSession = NeedInSessionType.YES)
@ServiceMethod(method = "dj.api.smartcarlife.business.analysis.merchant.bi.matter.handle", needInSession = NeedInSessionType.YES)
public RopResponse<Boolean> merchantBiMatterHandle(MerchantBiMatterHandleReq request) {
try {
LoginUserInfoResponse loginUserDTO = Optional.ofNullable(CommonUtil.getLoginUserInfo())
......@@ -83,10 +83,10 @@ public class BiMatterController {
return RopResponse.success(rpcResponse.getResult());
} catch (RpcServiceException e) {
log.info("dj.api.script.merchant.bi.matter.handle occur error!", e);
log.info("dj.api.smartcarlife.business.analysis.merchant.bi.matter.handle occur error!", e);
return RopResponse.error(e);
} catch (Exception e) {
log.info("dj.api.script.merchant.bi.matter.handle occur error!", e);
log.info("dj.api.smartcarlife.business.analysis.merchant.bi.matter.handle occur error!", e);
return RopResponse.result(DefaultErrorEnum.SERVICE_ERROR);
}
}
......
......@@ -15,18 +15,18 @@ public class BiMatterControllerTest extends BaseControllerTest {
public void merchantBiMatterAddTest() throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.add("v", "1.0.0");
params.add("method", "dj.api.pe.analysis.merchant.bi.matter.add");
params.add("method", "dj.api.smartcarlife.business.analysis.merchant.bi.matter.add");
params.add("storeNo", "44211668");
params.add("storeName", "明明长岭4s店B222");
params.add("businessType", "1");
params.add("description", "当个事做,上报联合国");
params.add("description", "请大声说大碗宽面~~");
params.add("onlineOperator[0].uuid", "8104840424a0455db573c5fb84ab7383");
params.add("onlineOperator[0].username", "区域督导天天");
params.add("onlineOperator[0].uuid", "17f70bc28c8f40ef9c260d05dbe28787");
params.add("onlineOperator[0].username", "陈希");
params.add("onlineOperator[1].uuid", "17f70bc28c8f40ef9c260d05dbe28787");
params.add("onlineOperator[1].username", "陈希");
params.add("areaOperator[0].uuid", "c359e4838e2547aaa140d9a67ec0b165");
params.add("areaOperator[0].username", "狗蛋");
params.add("sessionId", "9551b3d6-4486-45ee-9141-ee91f3de604b");
params.add("sessionId", "f57db715-128a-4fd1-bc40-abec63519bdc");
System.out.println(post(params));
}
......@@ -36,10 +36,10 @@ public class BiMatterControllerTest extends BaseControllerTest {
public void testMerchantBiMatterHandle() throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.add("v", "1.0.0");
params.add("method", "dj.api.script.merchant.bi.matter.handle");
params.add("id", "2");
params.add("handlingStrategy", "giaogiaogiaogiao,hahahaha,nika lufu");
params.add("sessionId", "6daef60d-58aa-4503-a4b8-d7d55785f452");
params.add("method", "dj.api.smartcarlife.business.analysis.merchant.bi.matter.handle");
params.add("id", "9");
params.add("handlingStrategy", "你看这个面,他又大又宽,你看这个碗,又大又圆,");
params.add("sessionId", "f57db715-128a-4fd1-bc40-abec63519bdc");
System.out.println(post(params));
}
......
  • @wangxw1
    commented
    Master

    Auto Review Result:

    代码审查报告

    问题描述和优化建议

    1. 功能实现的正确性与健壮性

      • 问题:BiMatterControllerTest 中 merchantBiMatterAddTest 方法中存在重复的 onlineOperator 参数,第二个 onlineOperator 的索引应为 1 而不是 0。
      • 建议:修正 onlineOperator 参数的索引,确保测试数据的正确性。
    2. 安全性与潜在风险

      • 问题:无明显安全漏洞,但日志记录方式可能存在敏感信息泄露的风险。
      • 建议:避免在日志中直接记录异常堆栈信息,考虑使用日志框架提供的占位符来记录错误信息,减少敏感信息泄露的风险。
    3. 是否符合最佳实践

      • 问题:日志信息中的错误描述不够明确,建议使用更具体的错误信息。
      • 建议:将 log.info("dj.api.smartcarlife.business.analysis.merchant.bi.matter.add occur error!", e); 修改为 log.error("Error occurred while processing method dj.api.smartcarlife.business.analysis.merchant.bi.matter.add", e);,并相应地修改其他日志记录。
      • 问题:测试用例中的 description 和 handlingStrategy 字段内容显得不专业,建议使用更具代表性的测试数据。
      • 建议:使用更具代表性的描述和策略文本,以便更好地模拟真实场景。
    4. 性能与资源利用效率

      • 问题:未发现明显的性能问题。
      • 建议:持续监控性能指标,确保在高并发场景下系统的稳定运行。
    5. Commits信息的清晰性与准确性

      • 问题:提交信息描述较为简单,未详细说明具体改动内容。
      • 建议:增加提交信息的详细描述,例如添加了哪些远程调用配置,解决了哪些问题等。

    评分明细

    1. 功能实现的正确性与健壮性:35/40
    2. 安全性与潜在风险:25/30
    3. 是否符合最佳实践:15/20
    4. 性能与资源利用效率:5/5
    5. Commits信息的清晰性与准确性:3/5

    总分: 83分


    总结:代码整体功能实现基本正确,但在日志记录、测试数据选择和提交信息的描述上还有改进空间。建议按照上述建议进行优化,以提高代码质量和可维护性。

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!