| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.buwan.service.inter.recommend.HomeVideoService; |
| | | import com.yeshi.buwan.util.*; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | import com.yeshi.buwan.domain.HomeNotice; |
| | | import com.yeshi.buwan.domain.HomeType; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.SystemInfo; |
| | | import com.yeshi.buwan.domain.system.SystemInfo; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoIntersection; |
| | |
| | | import com.yeshi.buwan.service.imp.HomeNoticeService; |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.imp.IntersectionService; |
| | | import com.yeshi.buwan.service.imp.OtherService; |
| | | import com.yeshi.buwan.service.imp.VideoManager; |
| | | import com.yeshi.buwan.service.imp.VideoService; |
| | | import com.yeshi.buwan.service.imp.WeiXinService; |
| | | import com.yeshi.buwan.util.DouBanUtil; |
| | | import com.yeshi.buwan.util.FileUtil; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | |
| | | private HomeTypeService homeTypeService; |
| | | |
| | | @Resource |
| | | private HomeVideoService homeVideoService; |
| | | |
| | | @Resource |
| | | private HomeAdService homeAdService; |
| | | @Resource |
| | | private WeiXinService weiXinService; |
| | |
| | | @Resource |
| | | private VideoService videoService; |
| | | |
| | | public VideoManager getVideoManager() { |
| | | return videoManager; |
| | | } |
| | | |
| | | public void setVideoManager(VideoManager videoManager) { |
| | | this.videoManager = videoManager; |
| | | } |
| | | |
| | | public HomeTypeService getHomeTypeService() { |
| | | return homeTypeService; |
| | | } |
| | | |
| | | public void setHomeTypeService(HomeTypeService homeTypeService) { |
| | | this.homeTypeService = homeTypeService; |
| | | } |
| | | |
| | | public HomeAdService getHomeAdService() { |
| | | return homeAdService; |
| | | } |
| | | |
| | | public void setHomeAdService(HomeAdService homeAdService) { |
| | | this.homeAdService = homeAdService; |
| | | } |
| | | |
| | | public WeiXinService getWeiXinService() { |
| | | return weiXinService; |
| | | } |
| | | |
| | | public void setWeiXinService(WeiXinService weiXinService) { |
| | | this.weiXinService = weiXinService; |
| | | } |
| | | |
| | | public AdService getAdService() { |
| | | return adService; |
| | | } |
| | | |
| | | public void setAdService(AdService adService) { |
| | | this.adService = adService; |
| | | } |
| | | |
| | | public HomeNoticeService getHomeNoticeService() { |
| | | return homeNoticeService; |
| | | } |
| | | |
| | | public void setHomeNoticeService(HomeNoticeService homeNoticeService) { |
| | | this.homeNoticeService = homeNoticeService; |
| | | } |
| | | |
| | | @RequestMapping(value = "/VideoServlet", method = RequestMethod.GET) |
| | | public void get(HttpServletRequest req, PrintWriter out) { |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/VideoServlet", method = RequestMethod.POST) |
| | | public String post(HttpServletRequest req, HttpServletResponse resp, PrintWriter out) { |
| | | public String post(HttpServletRequest req, HttpServletResponse resp, HttpSession session, PrintWriter out) { |
| | | try { |
| | | req.setCharacterEncoding("UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | |
| | | homeType.setHasMore(false); |
| | | } else |
| | | homeType.setHasMore(false); |
| | | homeType.setSystem(SystemUtil.getAdminSelectedSystem(session)); |
| | | homeTypeService.addHomeType(homeType); |
| | | return "hometype_add"; |
| | | } else if (type.equalsIgnoreCase("updateHomeType")) { |
| | |
| | | String ovideoid = map.get("ovideoid"); |
| | | String ointersection = map.get("ointersection"); |
| | | HomeAd ad = new HomeAd(); |
| | | |
| | | |
| | | ad.setSystem(SystemUtil.getAdminSelectedSystem(session)); |
| | | |
| | | ad.setAdmin((AdminInfo) req.getSession().getAttribute("ADMIN_INFO")); |
| | | |
| | | ad.setSystem(new SystemInfo(map.get("system"))); |
| | |
| | | String picture = req.getParameter("picture"); |
| | | HomeVideo video = homeTypeService.getHomeVideoById(id); |
| | | video.setPicture(picture); |
| | | homeTypeService.updateHomeVideo(video); |
| | | homeVideoService.updateHomeVideo(video); |
| | | |
| | | req.setAttribute("id", id); |
| | | return "homevideo_update"; |