| | |
| | | package com.yeshi.buwan.controller.admin; |
| | | |
| | | import java.io.PrintWriter; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.domain.HomeVideo; |
| | | import com.yeshi.buwan.domain.HotVideoType; |
| | | import com.yeshi.buwan.domain.SuperHotType; |
| | | import com.yeshi.buwan.domain.SuperVideoType; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.domain.web.CategoryRecommendVideoAdmin; |
| | | import com.yeshi.buwan.service.imp.ClassService; |
| | | import com.yeshi.buwan.service.imp.HomeTypeService; |
| | | import com.yeshi.buwan.service.imp.HotVideoTypeService; |
| | | import com.yeshi.buwan.service.imp.SystemService; |
| | | import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService; |
| | | import com.yeshi.buwan.util.Constant; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.SystemUtil; |
| | | import com.yeshi.buwan.web.tag.PageEntity; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.PrintWriter; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | | @RequestMapping("") |
| | |
| | | @Resource |
| | | private CategoryRecommendVideoService categoryRecommendVideoService; |
| | | |
| | | @Resource |
| | | private SystemService systemService; |
| | | |
| | | private String key; |
| | | private int pageIndex; |
| | | private int detailsystem; |
| | | |
| | | |
| | | public CategoryRecommendVideoService getCategoryRecommendVideoService() { |
| | | return categoryRecommendVideoService; |
| | | } |
| | | |
| | | public void setCategoryRecommendVideoService( |
| | | CategoryRecommendVideoService categoryRecommendVideoService) { |
| | | this.categoryRecommendVideoService = categoryRecommendVideoService; |
| | | } |
| | | |
| | | public SystemService getSystemService() { |
| | | return systemService; |
| | | } |
| | | |
| | | public void setSystemService(SystemService systemService) { |
| | | this.systemService = systemService; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | |
| | | this.detailsystem = detailsystem; |
| | | } |
| | | |
| | | public HotVideoTypeService getHotVideoTypeService() { |
| | | return hotVideoTypeService; |
| | | } |
| | | |
| | | public void setHotVideoTypeService(HotVideoTypeService hotVideoTypeService) { |
| | | this.hotVideoTypeService = hotVideoTypeService; |
| | | } |
| | | |
| | | public ClassService getClassService() { |
| | | return classService; |
| | | } |
| | | |
| | | public void setClassService(ClassService classService) { |
| | | this.classService = classService; |
| | | } |
| | | |
| | | public HomeTypeService getHomeTypeService() { |
| | | return homeTypeService; |
| | | } |
| | | |
| | | public void setHomeTypeService(HomeTypeService homeTypeService) { |
| | | this.homeTypeService = homeTypeService; |
| | | } |
| | | |
| | | @RequestMapping(value = "/ClassAdminServlet", method = RequestMethod.GET) |
| | | public String get(HttpServletRequest req, PrintWriter out) { |
| | |
| | | * @return |
| | | */ |
| | | @RequestMapping("/search") |
| | | public void categoryRecommendVideoList(HttpServletRequest request,PrintWriter out) { |
| | | public void categoryRecommendVideoList(HttpServletRequest request, HttpSession session, PrintWriter out) { |
| | | if (pageIndex == 0) |
| | | pageIndex = 1; |
| | | key = request.getParameter("key"); |
| | |
| | | videotype = StringUtil.isNullOrEmpty(videotype) ? "150" : videotype; |
| | | |
| | | List<CategoryRecommendVideoAdmin> list = categoryRecommendVideoService.getCategoryRecommendVideoAdmin(key, |
| | | Integer.parseInt(videotype), detailsystem, pageIndex); |
| | | Integer.parseInt(videotype), SystemUtil.getAdminSelectedSystemId(session), detailsystem, pageIndex); |
| | | long count = categoryRecommendVideoService.getCategoryRecommendVideoAdminCount(key, Integer.parseInt(videotype), |
| | | detailsystem); |
| | | SystemUtil.getAdminSelectedSystemId(session), detailsystem); |
| | | PageEntity pe = new PageEntity(); |
| | | pe.setPageIndex(pageIndex); |
| | | pe.setPageSize(1); |
| | |
| | | System.out.println(root.toString()); |
| | | out.print(root); |
| | | // dataMap.put("categoryRecommendVideoAdminList", list); |
| | | List<DetailSystem> detailSystemList = systemService.getDetailSystemList(); |
| | | // dataMap.put("detailSystemList", detailSystemList); |
| | | List<VideoType> typeList = classService.getFirstTypeList(""); |
| | | // dataMap.put("videoTypeList", typeList); |
| | | // json.put("data", data); |
| | | // System.out.println("jsonStr---------"+jsonStr); |