BannerController.java
1.5 KB
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
package com.w1hd.zzhnc.controller.pc;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.w1hd.zzhnc.service.BannerService;
import com.w1hd.zzhnc.vo.Vo_msg;
@Controller
@RequestMapping("/banner")
public class BannerController {
@Autowired
BannerService bannerService;
@RequestMapping("/bannerList")
public ModelAndView autoreplyIndex(Map<String, Object> map) {
ModelAndView mv = new ModelAndView("/pc/banner/bannerList", map);
return mv;
}
@ResponseBody
@RequestMapping(value = "/add", method = RequestMethod.POST)
public Object addBanner(@RequestParam("url") String url) {
return new Vo_msg(0, bannerService.addBanner(url));
}
@ResponseBody
@RequestMapping(value = "/{id}/delete", method = RequestMethod.GET)
public Object delete(@PathVariable("id") Integer id) {
return new Vo_msg(0, bannerService.deleteBanner(id));
}
@ResponseBody
@RequestMapping(value = "/list", method = RequestMethod.GET)
public Object list(@RequestParam("url") String url) {
return new Vo_msg(0, bannerService.getAll());
}
}