admin
2021-01-23 0a18a8cb0a7a57bf1f82df425251334c57f8c39a
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
55
56
57
58
59
60
61
62
63
64
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.DetailSystem;
import com.yeshi.buwan.domain.HotStar;
import com.yeshi.buwan.domain.SuperHotStar;
import com.yeshi.buwan.service.imp.StarService;
import com.yeshi.buwan.util.StringUtil;
 
@Controller
@RequestMapping("")
public class HotStarAdminController {
 
    @Resource
    private StarService starService;
 
    public StarService getStarService() {
        return starService;
    }
 
    public void setStarService(StarService starService) {
        this.starService = starService;
    }
 
    @RequestMapping(value = "/HotStarAdminServlet", 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("addSuperHotStar")) {// 获取来源列表
            String detailSystem = req.getParameter("system");
            String classid = req.getParameter("ids");
            if (!StringUtil.isNullOrEmpty(detailSystem) && !StringUtil.isNullOrEmpty(classid)) {
 
                SuperHotStar sz = new SuperHotStar();
                sz.setCreatetime(System.currentTimeMillis() + "");
                sz.setDetailSystem(new DetailSystem(detailSystem));
                sz.setHotStar(new HotStar(classid));
                starService.addSuperHotStar(sz);
            }
            out.print("SUCCESS");
        } else if (type.equalsIgnoreCase("deleteSuperHotStar")) {// 获取下级分类
            String detailSystem = req.getParameter("system");
            String classid = req.getParameter("ids");
            if (!StringUtil.isNullOrEmpty(detailSystem) && !StringUtil.isNullOrEmpty(classid)) {
                starService.deleteHotStarAdmin(classid, detailSystem);
            }
            out.print("SUCCESS");
        }
    }
 
}