Bläddra i källkod

修改119推送事件图片

bihuisong 1 år sedan
förälder
incheckning
ccc96364fd

+ 7 - 16
src/main/java/com/sooka/sponest/dataexchange/exchange/controller/ExchangeController.java

@@ -36,11 +36,10 @@ public class ExchangeController {
     private RemoteAuthBaseService remoteAuthBaseService;
     @Resource
     private RemoteEventBaseService remoteEventBaseService;
-    @Resource
-    private RedisService redisService;
 
     @Value("${}")
     private String url;
+    private final String pictureUrl = "http://116.142.80.13:8081/";
 
     /**
      * 获取秘钥接口
@@ -87,7 +86,7 @@ public class ExchangeController {
                 }
             }
             dataExchangeEntity.setPictureUrlList(pictureList);
-            R<?> result = remoteEventBaseService.saveDataExchangeEntity(dataExchangeEntity);
+            R<?> result = remoteEventBaseService.insert3rdSystemEvent(dataExchangeEntity);
             if (result.getCode() == 200) {
                 return R.ok("推送成功");
             } else {
@@ -99,22 +98,14 @@ public class ExchangeController {
     }
 
 
-    // 舍弃
-//    @PostMapping("/subscribeTo")
-//    @ResponseBody
-//    public R<?> dataSubscribeTo(@RequestBody String str) {
-//        R<?> result = remoteEventBaseService.subscribeTo(str);
-//        if (result.getCode() == 200) {
-//            redisService.deleteObject("eventKey");
-//            return R.ok("操作成功");
-//        } else {
-//            return R.fail("操作失败");
-//        }
-//    }
-
     @PostMapping("/receiveEventData")
     @ResponseBody
     public R<?> pushData(@RequestBody DataExchangeEntity dataExchangeEntity) {
+        List<String> pictureList = new ArrayList<>();
+        for (String picture : dataExchangeEntity.getEventPicture()) {
+            pictureList.add(pictureUrl + picture);
+        }
+        dataExchangeEntity.setEventPicture(pictureList);
         // TODO: 2024/1/9 0009 待修改
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("", dataExchangeEntity);

+ 1 - 1
src/main/java/com/sooka/sponest/dataexchange/remoteapi/fallback/center/event/RemoteEventBaseServiceFallbackFactory.java

@@ -25,7 +25,7 @@ public class RemoteEventBaseServiceFallbackFactory implements FallbackFactory<Re
         return new RemoteEventBaseService() {
 
             @Override
-            public R<?> saveDataExchangeEntity(DataExchangeEntity dataExchangeEntity) {
+            public R<?> insert3rdSystemEvent(DataExchangeEntity dataExchangeEntity) {
                 return null;
             }
 

+ 2 - 2
src/main/java/com/sooka/sponest/dataexchange/remoteapi/service/center/event/RemoteEventBaseService.java

@@ -21,8 +21,8 @@ import java.util.List;
 )
 public interface RemoteEventBaseService {
 
-    @PostMapping("/saveDataExchangeEntity")
-    public R<?> saveDataExchangeEntity(DataExchangeEntity dataExchangeEntity);
+    @PostMapping("/fireIncident/insert3rdSystemEvent")
+    public R<?> insert3rdSystemEvent(DataExchangeEntity dataExchangeEntity);
 
     @PostMapping("/subscribeTo")
     public R<?> subscribeTo(String list);