فهرست منبع

获取版本号更更改为读取oss中的scene.json

dengsixing 1 سال پیش
والد
کامیت
1e21dbd527

+ 6 - 0
pom.xml

@@ -189,6 +189,12 @@
             <version>3.0.0-SNAPSHOT</version>
         </dependency>
 
+        <dependency>
+            <groupId>com.fdkankan</groupId>
+            <artifactId>4dkankan-utils-fyun-oss</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+        </dependency>
+
     </dependencies>
 
     <dependencyManagement>

+ 8 - 4
src/main/java/com/fdkankan/external/service/impl/SceneOfflinePackagePushServiceImpl.java

@@ -28,6 +28,7 @@ import com.fdkankan.external.httpclient.HttpClient;
 import com.fdkankan.external.mapper.SceneOfflinePackagePushMapper;
 import com.fdkankan.external.service.*;
 import com.fdkankan.external.util.CmdUtils;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.web.response.Result;
@@ -100,7 +101,8 @@ public class SceneOfflinePackagePushServiceImpl extends ServiceImpl<SceneOffline
     private ICameraService cameraService;
     @Resource
     private RedisUtil redisUtil;
-
+    @Resource
+    private FYunFileServiceInterface fYunFileService;
 
 
     @Override
@@ -181,9 +183,11 @@ public class SceneOfflinePackagePushServiceImpl extends ServiceImpl<SceneOffline
                     SceneOfflinePackagePush lastPush = sceneOfflinePackagePushService.getLastByCondition(condition);
 
                     //查询版本号
-                    String getInfo = fdkkSceneHost.concat(String.format(getInfoUrl, scenePlus.getNum()));
-                    ResultData<Map<String, Object>> mapResultData = httpClient.get(getInfo, new HashMap<>(), new SuccessCallback(), new ErrorCallback());
-                    int version =  (int)mapResultData.getData().get("version");
+                    String sceneJsonStr = fYunFileService.getFileContent("scene_view_data/" + scenePlus.getNum() + "/data/scene.json");
+//                    String getInfo = fdkkSceneHost.concat(String.format(getInfoUrl, scenePlus.getNum()));
+//                    ResultData<Map<String, Object>> mapResultData = httpClient.get(getInfo, new HashMap<>(), new SuccessCallback(), new ErrorCallback());
+                    JSONObject sceneJson = JSON.parseObject(sceneJsonStr);
+                    int version =  sceneJson.getIntValue("version");
 
                     //如果没有推送过或者推送过但是版本号不一致,就需要推送
                     if(Objects.isNull(lastPush) || lastPush.getVersion() != version){

+ 9 - 0
src/main/resources/application-prod.yml

@@ -76,6 +76,15 @@ oss:
       old: https://4dkk.4dage.com
       new: https://zgwwzzzx-download.4dage.com
 
+fyun:
+  type: oss
+  key: LTAIUrvuHqj8pvry
+  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+  bucket: 4dkankan
+  coldBucket: 4dkk-bak  ##冷归档bucket
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  host: https://4dkk.4dage.com/
+
 file:
   offlineZip:
     dir: /mnt/external/temp/

+ 8 - 0
src/main/resources/application.yml

@@ -75,6 +75,14 @@ oss:
     4dkk:
       old: https://4dkk.4dage.com
       new: https://zgwwzzzx-download.4dage.com
+fyun:
+  type: oss
+  key: LTAIUrvuHqj8pvry
+  secret: JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+  bucket: 4dkankan
+  coldBucket: 4dkk-bak  ##冷归档bucket
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  host: https://4dkk.4dage.com/
 
 file:
   offlineZip: