@RequestMapping(value = "init") public ModelAndView initView(String unitId) { ModelAndView mav = new ModelAndView(); List<VideoDomain> videos = videoService.list(null, unitId, SHORT); mav.addObject("videos", videos); mav.addObject("unitId", unitId); mav.setViewName("/mgr/mgr"); return mav; }
@RequestMapping(value = "list") @ResponseBody public BaseMessage list(String unitId) { BaseMessage msg = null; if (StringUtils.isBlank(unitId)) { msg = BaseMessage.errorMsg("unitId is null"); return msg; } try { List<VideoDomain> videos = videoService.list(null, unitId, SHORT); VideoPlayOrderHelper.sortAscVideos(videos); msg = BaseMessage.successMsg("success", videos); } catch (Exception e) { e.printStackTrace(); msg = BaseMessage.errorMsg("error"); } return msg; }