Browse Source

fix updateRemoteResource

guozhaoshun 6 years ago
parent
commit
f63a665599

+ 2 - 43
rankin-resource-service/src/main/java/cn/rankin/resourceservice/service/ResourceService.java

@@ -304,51 +304,10 @@ public class ResourceService {
      */
     public APIResult<Resource> updateRemoteResource(Resource resource) {
 
-        APIResult<ResourceRemote> result = resourceProxy.findById(resource.getId());
-        log.info("Remote Server info: code={}, message={},data={}", result.getCode(), result.getMessage(),result.getData());
-        if (!result.getSuccess()) {
-            log.error("Remote Server Error: code={}, message={}", result.getCode(), result.getMessage());
-            APIResult errResult = APIResult.error(APICode.REMOTE_SERVER_ERROR);
-            errResult.setMessage(result.getMessage());
-            return errResult;
+        if (org.apache.commons.lang.StringUtils.isEmpty(resource.getId())) {
+            return APIResult.error(APICode.PARAMETER_ERROR);
         }
 
-
-/*        List<Map<String, Object>> videos = new ArrayList<>();
-        Map<String, Object> video = new HashMap<>();
-        video.put("bucket","efunbox");
-        video.put("path",resource.getPath());
-        video.put("format",resource.getFormat());
-        video.put("quality",resource.getQuality());
-        video.put("size",resource.getSize());
-
-        videos.add(video);
-
-        APIResult<ResourceDetail> apiResult = resourceProxy.updateResources(new HashMap<String, Object>(){
-            {
-                this.put("id", resource.getId());
-                this.put("no", resource.getCode());
-                this.put("title", resource.getName());
-                this.put("type", "1");
-                this.put("videos", videos);
-            }
-        });*/
-
- /*       Set<ResourceVideo> videos = result.getData().getVideos();
-        if(videos != null && videos.size() > 0){
-            Iterator<ResourceVideo> iterator = videos.iterator();
-            while(iterator.hasNext()){
-                ResourceVideo video = iterator.next();
-                video.setBucket("efunbox");
-                video.setPath(resource.getPath());
-                video.setQuality(resource.getQuality());
-                video.setFormat(resource.getFormat());
-                video.setSize(resource.getSize());
-                log.info("Remote Server info: video={}, message={},data={}", video);
-            }
-        }*/
-
-
         Set<ResourceVideo> videos = new HashSet<>();
         ResourceVideo video = new ResourceVideo();
         video.setId(resource.getId());