|
@@ -288,6 +288,7 @@ public class ResourceService {
|
|
|
|
|
|
APIResult<ResourceDetail> apiResult = resourceProxy.saveResources(resourceRemote);
|
|
APIResult<ResourceDetail> apiResult = resourceProxy.saveResources(resourceRemote);
|
|
log.info("saveResources: "+apiResult);
|
|
log.info("saveResources: "+apiResult);
|
|
|
|
+ log.error("Remote Server return: code={}, message={}", apiResult.getCode(), apiResult.getMessage());
|
|
if (!apiResult.getSuccess()) {
|
|
if (!apiResult.getSuccess()) {
|
|
return errorResourceAPIResult(apiResult);
|
|
return errorResourceAPIResult(apiResult);
|
|
}
|
|
}
|
|
@@ -304,6 +305,7 @@ public class ResourceService {
|
|
public APIResult<Resource> updateRemoteResource(Resource resource) {
|
|
public APIResult<Resource> updateRemoteResource(Resource resource) {
|
|
|
|
|
|
APIResult<ResourceRemote> result = resourceProxy.findById(resource.getId());
|
|
APIResult<ResourceRemote> result = resourceProxy.findById(resource.getId());
|
|
|
|
+ log.info("Remote Server info: code={}, message={},data={}", result.getCode(), result.getMessage(),result.getData());
|
|
if (!result.getSuccess()) {
|
|
if (!result.getSuccess()) {
|
|
log.error("Remote Server Error: code={}, message={}", result.getCode(), result.getMessage());
|
|
log.error("Remote Server Error: code={}, message={}", result.getCode(), result.getMessage());
|
|
APIResult errResult = APIResult.error(APICode.REMOTE_SERVER_ERROR);
|
|
APIResult errResult = APIResult.error(APICode.REMOTE_SERVER_ERROR);
|
|
@@ -332,7 +334,22 @@ public class ResourceService {
|
|
}
|
|
}
|
|
});*/
|
|
});*/
|
|
|
|
|
|
- Set<ResourceVideo> videos = new HashSet<>();
|
|
|
|
|
|
+ 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();
|
|
ResourceVideo video = new ResourceVideo();
|
|
video.setBucket("efunbox");
|
|
video.setBucket("efunbox");
|
|
video.setPath(resource.getPath());
|
|
video.setPath(resource.getPath());
|
|
@@ -352,7 +369,7 @@ public class ResourceService {
|
|
log.info("updateResources: "+apiResult);
|
|
log.info("updateResources: "+apiResult);
|
|
if (!apiResult.getSuccess()) {
|
|
if (!apiResult.getSuccess()) {
|
|
return errorResourceAPIResult(apiResult);
|
|
return errorResourceAPIResult(apiResult);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
// Resource resourceVO = apiResult.getData().toNativeResource();
|
|
// Resource resourceVO = apiResult.getData().toNativeResource();
|
|
return APIResult.ok();
|
|
return APIResult.ok();
|