xuzuoyun пре 5 година
родитељ
комит
7a952ce992

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

@@ -37,29 +37,29 @@ public class ActorController {
 
     @ResponseBody
     @RequestMapping(value = "/detail", method = RequestMethod.GET)
-    public Result<Map<String, Object>> getDetail(@RequestParam(name = "actorId") Long actorId) {
-        Result<Map<String, Object>> result = new Result<>();
+    public Result<Actor> getDetail(@RequestParam(name = "actorId") Long actorId) {
+        Result<Actor> result = new Result<>();
         Actor actor = actorService.getById(actorId);
-        ActorComment actorComment = new ActorComment();
-        actorComment.setActorId(actorId);
-        QueryWrapper<ActorComment> actorCommentQueryWrapper = QueryGenerator.initQueryWrapper(actorComment, null);
-        List<ActorComment> actorCommentList = actorCommentService.list(actorCommentQueryWrapper);
-
-        ActorPhoto actorPhoto = new ActorPhoto();
-        actorPhoto.setActorId(actorId);
-        QueryWrapper<ActorPhoto> actorPhotoQueryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, null);
-        List<ActorPhoto> actorPhotoList = actorPhotoService.list(actorPhotoQueryWrapper);
-
-        ActorVideo actorVideo = new ActorVideo();
-        actorVideo.setActorId(actorId);
-        QueryWrapper<ActorVideo> actorVideoQueryWrapper = QueryGenerator.initQueryWrapper(actorVideo, null);
-        List<ActorVideo> actorVideoList = actorVideoService.list(actorVideoQueryWrapper);
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("actor", actor);
-        map.put("actorCommentList", actorCommentList);
-        map.put("actorPhotoList", actorPhotoList);
-        map.put("actorVideoList", actorVideoList);
-        result.setResult(map);
+//        ActorComment actorComment = new ActorComment();
+//        actorComment.setActorId(actorId);
+//        QueryWrapper<ActorComment> actorCommentQueryWrapper = QueryGenerator.initQueryWrapper(actorComment, null);
+//        List<ActorComment> actorCommentList = actorCommentService.list(actorCommentQueryWrapper);
+//
+//        ActorPhoto actorPhoto = new ActorPhoto();
+//        actorPhoto.setActorId(actorId);
+//        QueryWrapper<ActorPhoto> actorPhotoQueryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, null);
+//        List<ActorPhoto> actorPhotoList = actorPhotoService.list(actorPhotoQueryWrapper);
+//
+//        ActorVideo actorVideo = new ActorVideo();
+//        actorVideo.setActorId(actorId);
+//        QueryWrapper<ActorVideo> actorVideoQueryWrapper = QueryGenerator.initQueryWrapper(actorVideo, null);
+//        List<ActorVideo> actorVideoList = actorVideoService.list(actorVideoQueryWrapper);
+//        Map<String, Object> map = new HashMap<String, Object>();
+//        map.put("actor", actor);
+//        map.put("actorCommentList", actorCommentList);
+//        map.put("actorPhotoList", actorPhotoList);
+//        map.put("actorVideoList", actorVideoList);
+        result.setResult(actor);
         result.setSuccess(true);
         return result;
     }
@@ -88,6 +88,136 @@ public class ActorController {
         return result;
     }
 
+    @GetMapping(value = "/photo/list")
+    public Result<IPage<ActorPhoto>> queryPhotoPageList(ActorPhoto actorPhoto,
+                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                        @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                        HttpServletRequest req) {
+        Result<IPage<ActorPhoto>> result = new Result<IPage<ActorPhoto>>();
+
+        QueryWrapper<ActorPhoto> queryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, req.getParameterMap());
+        Page<ActorPhoto> page = new Page<ActorPhoto>(pageNo, pageSize);
+        IPage<ActorPhoto> pageList = actorPhotoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @GetMapping(value = "/comment/list")
+    public Result<IPage<ActorComment>> queryCommentPageList(ActorComment actorComment,
+                                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                            HttpServletRequest req) {
+        Result<IPage<ActorComment>> result = new Result<IPage<ActorComment>>();
+
+        QueryWrapper<ActorComment> queryWrapper = QueryGenerator.initQueryWrapper(actorComment, req.getParameterMap());
+        Page<ActorComment> page = new Page<ActorComment>(pageNo, pageSize);
+        IPage<ActorComment> pageList = actorCommentService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @DeleteMapping(value = "/comment/delete")
+    public Result<ActorComment> deleteComment(@RequestParam(name = "id", required = true) String id) {
+        Result<ActorComment> result = new Result<ActorComment>();
+        ActorComment actorComment = actorCommentService.getById(id);
+        if (actorComment == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = actorCommentService.removeById(id);
+            if (ok) {
+                result.success("删除成功!");
+            }
+        }
+        return result;
+    }
+
+    @DeleteMapping(value = "/video/delete")
+    public Result<ActorVideo> deleteVideo(@RequestParam(name = "id", required = true) String id) {
+        Result<ActorVideo> result = new Result<ActorVideo>();
+        ActorVideo actorVideo = actorVideoService.getById(id);
+        if (actorVideo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = actorVideoService.removeById(id);
+            if (ok) {
+                result.success("删除成功!");
+            }
+        }
+        return result;
+    }
+
+    @DeleteMapping(value = "/photo/delete")
+    public Result<ActorPhoto> deletePhoto(@RequestParam(name = "id", required = true) String id) {
+        Result<ActorPhoto> result = new Result<ActorPhoto>();
+        ActorPhoto actorPhoto = actorPhotoService.getById(id);
+        if (actorPhoto == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = actorPhotoService.removeById(id);
+            if (ok) {
+                result.success("删除成功!");
+            }
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/comment/add")
+    public Result<ActorComment> addComment(ActorComment actorComment) {
+        Result<ActorComment> result = new Result<ActorComment>();
+        try {
+            actorCommentService.save(actorComment);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/video/add")
+    public Result<ActorVideo> addVideo(ActorVideo actorVideo) {
+        Result<ActorVideo> result = new Result<ActorVideo>();
+        try {
+            actorVideoService.save(actorVideo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/photo/add")
+    public Result<ActorPhoto> addPhoto(ActorPhoto actorPhoto) {
+        Result<ActorPhoto> result = new Result<ActorPhoto>();
+        try {
+            actorPhotoService.save(actorPhoto);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @GetMapping(value = "/video/list")
+    public Result<IPage<ActorVideo>> queryVideoPageList(ActorVideo actorVideo,
+                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                        @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);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+
     /**
      * 添加
      *
@@ -99,22 +229,22 @@ public class ActorController {
         Result<Actor> result = new Result<Actor>();
         try {
             actorService.save(actor);
-            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());
+//                    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);
+//                }
+//            }
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -138,31 +268,31 @@ public class ActorController {
             result.error500("未找到对应实体");
         } else {
             boolean ok = actorService.updateById(actor);
-            ActorPhoto actorPhoto = new ActorPhoto();
-            actorPhoto.setActorId(actor.getId());
-            QueryWrapper photoQueryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, null);
-            actorPhotoService.remove(photoQueryWrapper);
-
-            ActorVideo actorVideo = new ActorVideo();
-            actorVideo.setActorId(actor.getId());
-            QueryWrapper videoQueryWrapper = QueryGenerator.initQueryWrapper(actorVideo, null);
-            actorVideoService.remove(videoQueryWrapper);
-            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);
-                }
-            }
+//            ActorPhoto actorPhoto = new ActorPhoto();
+//            actorPhoto.setActorId(actor.getId());
+//            QueryWrapper photoQueryWrapper = QueryGenerator.initQueryWrapper(actorPhoto, null);
+//            actorPhotoService.remove(photoQueryWrapper);
+//
+//            ActorVideo actorVideo = new ActorVideo();
+//            actorVideo.setActorId(actor.getId());
+//            QueryWrapper videoQueryWrapper = QueryGenerator.initQueryWrapper(actorVideo, null);
+//            actorVideoService.remove(videoQueryWrapper);
+//            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);
+//                }
+//            }
             //TODO 返回false说明什么?
             if (ok) {
                 result.success("修改成功!");

+ 194 - 70
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/YardController.java

@@ -1,10 +1,7 @@
 package org.jeecg.modules.ctop.controller;
 
 import cn.com.ctop.manage.modules.actor.entity.*;
-import cn.com.ctop.manage.modules.actor.service.IYardPhotoService;
-import cn.com.ctop.manage.modules.actor.service.IYardSchedulerService;
-import cn.com.ctop.manage.modules.actor.service.IYardService;
-import cn.com.ctop.manage.modules.actor.service.IYardVideoService;
+import cn.com.ctop.manage.modules.actor.service.*;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -13,11 +10,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 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
@@ -31,30 +24,32 @@ public class YardController {
     private IYardService yardService;
     @Autowired
     private IYardVideoService yardVideoService;
+    @Autowired
+    private IYardCommentService yardCommentService;
 
     @ResponseBody
     @RequestMapping(value = "/detail", method = RequestMethod.GET)
-    public Result<Map<String, Object>> getDetail(@RequestParam(name = "yardId") Long yardId) {
-        Result<Map<String, Object>> result = new Result<>();
-        Yard yard = yardService.getById(yardId);
-        YardPhoto yardPhoto = new YardPhoto();
-        YardVideo yardVideo = new YardVideo();
-        YardScheduler yardScheduler = new YardScheduler();
-        yardPhoto.setYardId(yardId);
-        yardVideo.setYardId(yardId);
-        yardScheduler.setYardId(yardId);
-        QueryWrapper<YardPhoto> yardPhotoQueryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, null);
-        QueryWrapper<YardVideo> yardVideoQueryWrapper = QueryGenerator.initQueryWrapper(yardVideo, null);
-        QueryWrapper<YardScheduler> yardSchedulerQueryWrapper = QueryGenerator.initQueryWrapper(yardScheduler, null);
-        List<YardPhoto> yardPhotoList = yardPhotoService.list(yardPhotoQueryWrapper);
-        List<YardVideo> yardVideoList = yardVideoService.list(yardVideoQueryWrapper);
-        List<YardScheduler> yardSchedulerList = yardSchedulerService.list(yardSchedulerQueryWrapper);
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("yard", yard);
-        map.put("yardPhotoList", yardPhotoList);
-        map.put("yardVideoList", yardVideoList);
-        map.put("yardSchedulerList", yardSchedulerList);
-        result.setResult(map);
+    public Result<Yard> getDetail(@RequestParam(name = "id") Long id) {
+        Result<Yard> result = new Result<>();
+        Yard yard = yardService.getById(id);
+//        YardPhoto yardPhoto = new YardPhoto();
+//        YardVideo yardVideo = new YardVideo();
+//        YardScheduler yardScheduler = new YardScheduler();
+//        yardPhoto.setYardId(yardId);
+//        yardVideo.setYardId(yardId);
+//        yardScheduler.setYardId(yardId);
+//        QueryWrapper<YardPhoto> yardPhotoQueryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, null);
+//        QueryWrapper<YardVideo> yardVideoQueryWrapper = QueryGenerator.initQueryWrapper(yardVideo, null);
+//        QueryWrapper<YardScheduler> yardSchedulerQueryWrapper = QueryGenerator.initQueryWrapper(yardScheduler, null);
+//        List<YardPhoto> yardPhotoList = yardPhotoService.list(yardPhotoQueryWrapper);
+//        List<YardVideo> yardVideoList = yardVideoService.list(yardVideoQueryWrapper);
+//        List<YardScheduler> yardSchedulerList = yardSchedulerService.list(yardSchedulerQueryWrapper);
+//        Map<String, Object> map = new HashMap<String, Object>();
+//        map.put("yard", yard);
+//        map.put("yardPhotoList", yardPhotoList);
+//        map.put("yardVideoList", yardVideoList);
+//        map.put("yardSchedulerList", yardSchedulerList);
+        result.setResult(yard);
         result.setSuccess(true);
         return result;
     }
@@ -64,22 +59,22 @@ public class YardController {
         Result<Yard> result = new Result<Yard>();
         try {
             yardService.save(yard);
-            if (yard.getImageUrl() != null && yard.getImageUrl().size() > 0) {
-                for (String url : yard.getImageUrl()) {
-                    YardPhoto yardPhoto = new YardPhoto();
-                    yardPhoto.setYardId(yard.getId());
-                    yardPhoto.setPhotoUrl("http:" + url);
-                    yardPhotoService.save(yardPhoto);
-                }
-            }
-            if (yard.getVideoUrl() != null && yard.getVideoUrl().size() > 0) {
-                for (String url : yard.getVideoUrl()) {
-                    YardVideo yardVideo = new YardVideo();
-                    yardVideo.setYardId(yard.getId());
-                    yardVideo.setVideoUrl("http:" + url);
-                    yardVideoService.save(yardVideo);
-                }
-            }
+//            if (yard.getImageUrl() != null && yard.getImageUrl().size() > 0) {
+//                for (String url : yard.getImageUrl()) {
+//                    YardPhoto yardPhoto = new YardPhoto();
+//                    yardPhoto.setYardId(yard.getId());
+//                    yardPhoto.setPhotoUrl("http:" + url);
+//                    yardPhotoService.save(yardPhoto);
+//                }
+//            }
+//            if (yard.getVideoUrl() != null && yard.getVideoUrl().size() > 0) {
+//                for (String url : yard.getVideoUrl()) {
+//                    YardVideo yardVideo = new YardVideo();
+//                    yardVideo.setYardId(yard.getId());
+//                    yardVideo.setVideoUrl("http:" + url);
+//                    yardVideoService.save(yardVideo);
+//                }
+//            }
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -97,31 +92,31 @@ public class YardController {
             result.error500("未找到对应实体");
         } else {
             boolean ok = yardService.updateById(yard);
-            YardPhoto yardPhoto = new YardPhoto();
-            yardPhoto.setYardId(yard.getId());
-            QueryWrapper photoQueryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, null);
-            yardPhotoService.remove(photoQueryWrapper);
-
-            YardVideo yardVideo = new YardVideo();
-            yardVideo.setYardId(yard.getId());
-            QueryWrapper videoQueryWrapper = QueryGenerator.initQueryWrapper(yardVideo, null);
-            yardVideoService.remove(videoQueryWrapper);
-            if (yard.getImageUrl() != null && yard.getImageUrl().size() > 0) {
-                for (String url : yard.getImageUrl()) {
-                    YardPhoto photo = new YardPhoto();
-                    photo.setYardId(yard.getId());
-                    photo.setPhotoUrl("http:" + url);
-                    yardPhotoService.save(photo);
-                }
-            }
-            if (yard.getVideoUrl() != null && yard.getVideoUrl().size() > 0) {
-                for (String url : yard.getVideoUrl()) {
-                    YardVideo video = new YardVideo();
-                    video.setYardId(yard.getId());
-                    video.setVideoUrl("http:" + url);
-                    yardVideoService.save(video);
-                }
-            }
+//            YardPhoto yardPhoto = new YardPhoto();
+//            yardPhoto.setYardId(yard.getId());
+//            QueryWrapper photoQueryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, null);
+//            yardPhotoService.remove(photoQueryWrapper);
+//
+//            YardVideo yardVideo = new YardVideo();
+//            yardVideo.setYardId(yard.getId());
+//            QueryWrapper videoQueryWrapper = QueryGenerator.initQueryWrapper(yardVideo, null);
+//            yardVideoService.remove(videoQueryWrapper);
+//            if (yard.getImageUrl() != null && yard.getImageUrl().size() > 0) {
+//                for (String url : yard.getImageUrl()) {
+//                    YardPhoto photo = new YardPhoto();
+//                    photo.setYardId(yard.getId());
+//                    photo.setPhotoUrl("http:" + url);
+//                    yardPhotoService.save(photo);
+//                }
+//            }
+//            if (yard.getVideoUrl() != null && yard.getVideoUrl().size() > 0) {
+//                for (String url : yard.getVideoUrl()) {
+//                    YardVideo video = new YardVideo();
+//                    video.setYardId(yard.getId());
+//                    video.setVideoUrl("http:" + url);
+//                    yardVideoService.save(video);
+//                }
+//            }
             //TODO 返回false说明什么?
             if (ok) {
                 result.success("修改成功!");
@@ -144,4 +139,133 @@ public class YardController {
         result.setResult(pageList);
         return result;
     }
+
+    @GetMapping(value = "/photo/list")
+    public Result<IPage<YardPhoto>> queryPhotoPageList(YardPhoto yardPhoto,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<YardPhoto>> result = new Result<IPage<YardPhoto>>();
+
+        QueryWrapper<YardPhoto> queryWrapper = QueryGenerator.initQueryWrapper(yardPhoto, req.getParameterMap());
+        Page<YardPhoto> page = new Page<YardPhoto>(pageNo, pageSize);
+        IPage<YardPhoto> pageList = yardPhotoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @GetMapping(value = "/comment/list")
+    public Result<IPage<YardComment>> queryCommentPageList(YardComment yardComment,
+                                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                           @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                           HttpServletRequest req) {
+        Result<IPage<YardComment>> result = new Result<IPage<YardComment>>();
+
+        QueryWrapper<YardComment> queryWrapper = QueryGenerator.initQueryWrapper(yardComment, req.getParameterMap());
+        Page<YardComment> page = new Page<YardComment>(pageNo, pageSize);
+        IPage<YardComment> pageList = yardCommentService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
+    @DeleteMapping(value = "/comment/delete")
+    public Result<YardComment> deleteComment(@RequestParam(name = "id", required = true) String id) {
+        Result<YardComment> result = new Result<YardComment>();
+        YardComment yardComment = yardCommentService.getById(id);
+        if (yardComment == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = yardCommentService.removeById(id);
+            if (ok) {
+                result.success("删除成功!");
+            }
+        }
+        return result;
+    }
+
+    @DeleteMapping(value = "/video/delete")
+    public Result<YardVideo> deleteVideo(@RequestParam(name = "id", required = true) String id) {
+        Result<YardVideo> result = new Result<YardVideo>();
+        YardVideo yardVideo = yardVideoService.getById(id);
+        if (yardVideo == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = yardVideoService.removeById(id);
+            if (ok) {
+                result.success("删除成功!");
+            }
+        }
+        return result;
+    }
+
+    @DeleteMapping(value = "/photo/delete")
+    public Result<YardPhoto> deletePhoto(@RequestParam(name = "id", required = true) String id) {
+        Result<YardPhoto> result = new Result<YardPhoto>();
+        YardPhoto yardPhoto = yardPhotoService.getById(id);
+        if (yardPhoto == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = yardPhotoService.removeById(id);
+            if (ok) {
+                result.success("删除成功!");
+            }
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/comment/add")
+    public Result<YardComment> addComment(YardComment yardComment) {
+        Result<YardComment> result = new Result<YardComment>();
+        try {
+            yardCommentService.save(yardComment);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/video/add")
+    public Result<YardVideo> addVideo(YardVideo yardVideo) {
+        Result<YardVideo> result = new Result<YardVideo>();
+        try {
+            yardVideoService.save(yardVideo);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @PostMapping(value = "/photo/add")
+    public Result<YardPhoto> addPhoto(YardPhoto yardPhoto) {
+        Result<YardPhoto> result = new Result<YardPhoto>();
+        try {
+            yardPhotoService.save(yardPhoto);
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+    @GetMapping(value = "/video/list")
+    public Result<IPage<YardVideo>> queryVideoPageList(YardVideo yardVideo,
+                                                       @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                       @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                       HttpServletRequest req) {
+        Result<IPage<YardVideo>> result = new Result<IPage<YardVideo>>();
+
+        QueryWrapper<YardVideo> queryWrapper = QueryGenerator.initQueryWrapper(yardVideo, req.getParameterMap());
+        Page<YardVideo> page = new Page<YardVideo>(pageNo, pageSize);
+        IPage<YardVideo> pageList = yardVideoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
 }

+ 27 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/actor/entity/YardComment.java

@@ -0,0 +1,27 @@
+package cn.com.ctop.manage.modules.actor.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+@Data
+@TableName("ctop_yard_comment")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class YardComment {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private Long yardId;
+    private String comment;
+    private String createBy;
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+}

+ 8 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/actor/mapper/YardCommentMapper.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.manage.modules.actor.mapper;
+
+import cn.com.ctop.manage.modules.actor.entity.ActorComment;
+import cn.com.ctop.manage.modules.actor.entity.YardComment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface YardCommentMapper extends BaseMapper<YardComment> {
+}

+ 8 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/actor/service/IYardCommentService.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.manage.modules.actor.service;
+
+import cn.com.ctop.manage.modules.actor.entity.ActorComment;
+import cn.com.ctop.manage.modules.actor.entity.YardComment;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IYardCommentService extends IService<YardComment> {
+}

+ 14 - 0
module-ctop/src/main/java/cn/com/ctop/manage/modules/actor/service/impl/YardCommentServiceImpl.java

@@ -0,0 +1,14 @@
+package cn.com.ctop.manage.modules.actor.service.impl;
+
+import cn.com.ctop.manage.modules.actor.entity.ActorComment;
+import cn.com.ctop.manage.modules.actor.entity.YardComment;
+import cn.com.ctop.manage.modules.actor.mapper.ActorCommentMapper;
+import cn.com.ctop.manage.modules.actor.mapper.YardCommentMapper;
+import cn.com.ctop.manage.modules.actor.service.IActorCommentService;
+import cn.com.ctop.manage.modules.actor.service.IYardCommentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service
+public class YardCommentServiceImpl extends ServiceImpl<YardCommentMapper, YardComment> implements IYardCommentService {
+}