Browse Source

fix updateRemoteResource

guozhaoshun 6 years ago
parent
commit
b38ddc7529

+ 7 - 6
rankin-resource-service/src/main/java/cn/rankin/resourceservice/service/ResourceService.java

@@ -334,7 +334,7 @@ public class ResourceService {
             }
         });*/
 
-        Set<ResourceVideo> videos = result.getData().getVideos();
+ /*       Set<ResourceVideo> videos = result.getData().getVideos();
         if(videos != null && videos.size() > 0){
             Iterator<ResourceVideo> iterator = videos.iterator();
             while(iterator.hasNext()){
@@ -346,11 +346,12 @@ public class ResourceService {
                 video.setSize(resource.getSize());
                 log.info("Remote Server info: video={}, message={},data={}", video);
             }
-        }
+        }*/
 
 
-/*        Set<ResourceVideo> videos = new HashSet<>();
+        Set<ResourceVideo> videos = new HashSet<>();
         ResourceVideo video = new ResourceVideo();
+        video.setId(resource.getId());
         video.setBucket("efunbox");
         video.setPath(resource.getPath());
         video.setQuality(resource.getQuality());
@@ -360,18 +361,18 @@ public class ResourceService {
 
 
         ResourceRemote resourceRemote = new ResourceRemote();
+        resourceRemote.setId(resource.getId());
         resourceRemote.setNo(resource.getCode());
         resourceRemote.setTitle(resource.getName());
         resourceRemote.setType(resource.getType());
         resourceRemote.setVideos(videos);
 
         APIResult<ResourceDetail> apiResult = resourceProxy.updateResources(resourceRemote);
-        log.info("updateResources: "+apiResult);
         if (!apiResult.getSuccess()) {
             return errorResourceAPIResult(apiResult);
-        }*/
+        }
 
-//        Resource resourceVO = apiResult.getData().toNativeResource();
+        log.info("Remote Server info: code={}, message={},data={}", apiResult.getCode(), apiResult.getMessage(),apiResult.getData());
         return APIResult.ok();
     }