CacheController.java
2.04 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.fh.controller.sunvote.cache;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.fh.controller.base.BaseController;
import com.fh.entity.Page;
import com.fh.util.AppUtil;
import com.fh.util.ObjectExcelView;
import com.fh.util.PageData;
import com.fh.util.Jurisdiction;
import com.fh.util.Tools;
import com.fh.service.sunvote.cache.CacheManager;
/**
* 说明:缓存管理
* 创建人:FH Q313596790
* 创建时间:2018-08-08
*/
@Controller
@RequestMapping(value="/cache")
public class CacheController extends BaseController {
String menuUrl = "cache/list.do"; //菜单地址(权限用)
@Resource(name="cacheService")
private CacheManager cacheService;
/**保存
* @param
* @throws Exception
*/
@RequestMapping(value="/save")
public ModelAndView save() throws Exception{
logBefore(logger, Jurisdiction.getUsername()+"新增Cache");
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
pd = this.getPageData();
pd.put("KEY", ""); //key
pd.put("CACHE", ""); //cache
cacheService.save(pd);
mv.addObject("msg","success");
mv.setViewName("save_result");
return mv;
}
/**删除
* @param out
* @throws Exception
*/
@RequestMapping(value="/delete")
public void delete(PrintWriter out) throws Exception{
logBefore(logger, Jurisdiction.getUsername()+"删除Cache");
PageData pd = new PageData();
pd = this.getPageData();
cacheService.delete(pd);
out.write("success");
out.close();
}
}