admin
2021-04-27 f3ff5ab043cf612e119fd90cd82e49b2cfc2ab5a
src/main/java/com/yeshi/buwan/controller/admin/api/HomeTypeController.java
@@ -13,6 +13,7 @@
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.service.inter.recommend.HomeVideoService;
import com.yeshi.buwan.util.SystemUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -42,6 +43,9 @@
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private HomeVideoService homeVideoService;
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
@@ -138,13 +142,13 @@
                    hv.setTag(tag);
                }
                hv.setType(new HomeType(ht));
                hv.setVideo(new VideoInfo(vid));
                hv.setVideoId(vid);
                hv.setBigPicture(false);
                list.add(hv);
            }
        }
        homeTypeService.addHomeTypeVideo(list);
        homeVideoService.addHomeVideo(list);
        JSONObject object = new JSONObject();
        object.put("code", 0);
        object.put("msg", "添加成功");
@@ -278,12 +282,12 @@
    @RequestMapping(value = "/gethomevideolist", method = RequestMethod.POST)
    public void getHomeVideoList(long id, int page, String key, PrintWriter out) {
        key = StringUtil.isNullOrEmpty(key) ? "" : key;
        List<HomeVideo> list = homeTypeService.getHomeVideoList(id + "", key, page);
        List<HomeVideo> list = homeVideoService.getHomeVideoList(id + "", key, page);
        for (HomeVideo homeVideo : list) {
            homeVideo.setType(null);
            homeVideo.setAdmin(null);
        }
        long count = homeTypeService.getHomeVideoListCount(id + "", key);
        long count = homeVideoService.getHomeVideoListCount(id + "", key);
        PageEntity pe = new PageEntity();
        pe.setPageIndex(page);
        pe.setPageSize(Constant.pageCount);
@@ -304,7 +308,7 @@
    public void deleteHomeVideo(String ids, PrintWriter out) {
        String[] idStrs = ids.split(",");
        for (String id : idStrs) {
            homeTypeService.deleteHomeVideo(new HomeVideo(id));
            homeVideoService.deleteHomeVideo(new HomeVideo(id));
        }
        JSONObject object = new JSONObject();
        object.put("code", 0);
@@ -349,7 +353,7 @@
            }
            hv.setOrderby(ob);
            hv.setBigPicture(bigPicture);
            homeTypeService.updateHomeVideo(hv);
            homeVideoService.updateHomeVideo(hv);
            JSONObject object = new JSONObject();
            object.put("code", 0);
            object.put("msg", "更新成功");