admin
2021-04-25 36aafca8d6c1964bb755fe2ae030b163b6d0f92b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.yeshi.buwan.controller.admin;
 
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
 
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo;
import com.yeshi.buwan.domain.recommend.SuperCategoryRecommendVideo;
import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService;
import com.yeshi.buwan.util.StringUtil;
 
@Controller
@RequestMapping("")
public class CategoryRecommendVideoAdminController {
 
    @Resource
    private CategoryRecommendVideoService categoryRecommendVideoService;
 
    @RequestMapping(value = "/CategoryRecommendVideoAdminServlet", method = RequestMethod.GET)
    public void get(HttpServletRequest req, PrintWriter out) {
        try {
            req.setCharacterEncoding("UTF-8");
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }
        String type = req.getParameter("type");
        if (type.equalsIgnoreCase("addSuperCategoryRecommendVideo")) {// 获取来源列表
            String detailSystem = req.getParameter("system");
            String classid = req.getParameter("ids");
            if (!StringUtil.isNullOrEmpty(detailSystem) && !StringUtil.isNullOrEmpty(classid)) {
                SuperCategoryRecommendVideo sz=new SuperCategoryRecommendVideo();
                sz.setDetailSystem(new DetailSystem(detailSystem));
                sz.setCategoryRecommendVideo(new CategoryRecommendVideo(classid));
                categoryRecommendVideoService.addSuperCategoryRecommendVideo(sz);
            }
            out.print("SUCCESS");
        } else if (type.equalsIgnoreCase("deleteSuperCategoryRecommendVideo")) {// 获取下级分类
            String detailSystem = req.getParameter("system");
            String classid = req.getParameter("ids");
            if (!StringUtil.isNullOrEmpty(detailSystem) && !StringUtil.isNullOrEmpty(classid)) {
                categoryRecommendVideoService.deleteCategoryRecommendVideoAdmin(classid, detailSystem);
            }
            out.print("SUCCESS");
        }
    }
 
}