Pārlūkot izejas kodu

演员管理添加图片集合 视频集合

yumeng 6 gadi atpakaļ
vecāks
revīzija
5c1b4ec555

+ 27 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java

@@ -20,9 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 @RestController
 @Slf4j
@@ -210,7 +207,6 @@ public class ActorController {
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
         Result<IPage<ActorVideo>> result = new Result<IPage<ActorVideo>>();
-
         QueryWrapper<ActorVideo> queryWrapper = QueryGenerator.initQueryWrapper(actorVideo, req.getParameterMap());
         Page<ActorVideo> page = new Page<ActorVideo>(pageNo, pageSize);
         IPage<ActorVideo> pageList = actorVideoService.page(page, queryWrapper);
@@ -231,22 +227,33 @@ public class ActorController {
         Result<Actor> result = new Result<Actor>();
         try {
 
-//            if (actor.getImageUrl() != null && actor.getImageUrl().size() > 0) {
-//                for (String url : actor.getImageUrl()) {
-//                    ActorPhoto photo = new ActorPhoto();
-//                    photo.setActorId(actor.getId());
-//                    photo.setPhotoUrl("http:" + url);
-//                    actorPhotoService.save(photo);
-//                }
-//            }
-//            if (actor.getVideoUrl() != null && actor.getVideoUrl().size() > 0) {
-//                for (String url : actor.getVideoUrl()) {
-//                    ActorVideo video = new ActorVideo();
-//                    video.setActorId(actor.getId());
-//                    video.setVideoUrl("http:" + url);
-//                    actorVideoService.save(video);
-//                }
-//            }
+            if (actor.getImageUrl() != null && actor.getImageUrl().size() > 0) {
+                for (String url : actor.getImageUrl()) {
+                    ActorPhoto photo = new ActorPhoto();
+                    photo.setActorId(actor.getId());
+
+                    if (!Check.isNull(url)) {
+                        if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                            photo.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                        }
+                    }
+                    actorPhotoService.save(photo);
+                }
+            }
+            if (actor.getVideoUrl() != null && actor.getVideoUrl().size() > 0) {
+                for (String url : actor.getVideoUrl()) {
+                    ActorVideo video = new ActorVideo();
+                    video.setActorId(actor.getId());
+                    if (!Check.isNull(url)) {
+                        if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                            video.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
+                        }
+                    }
+
+
+                    actorVideoService.save(video);
+                }
+            }
 
             String coverUrl = actor.getCoverUrl();
             if (!Check.isNull(coverUrl)) {