1
zj
2025-04-17 ff2d1f5acdadc466d7e199028ef385ae8ca277e7
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
package project.web.admin;
 
import java.util.HashMap;
import java.util.Map;
 
import javax.servlet.http.HttpServletRequest;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import kernel.util.JsonUtils;
import kernel.util.StringUtils;
import project.tip.TipService;
import security.web.BaseSecurityAction;
 
/**
 * 管理员消息通知
 */
@RestController
public class AdminTipController extends BaseSecurityAction {
    
    @Autowired
    private TipService tipService;
 
    private final String action = "normal/adminTipAction!";
    
    @RequestMapping(value = action + "getTips.action")
    public String getTips() {
        if (!StringUtils.isNullOrEmpty(getLoginPartyId())) {
            return "";
        }
        Map<String, Object> result = new HashMap<String, Object>();
        result.put("tipList", tipService.cacheSumTips(this.getUsername_login()));
        return JsonUtils.getJsonString(result);
    }
 
    @RequestMapping(value = action + "getNewTips.action")
    public String getNewTips(HttpServletRequest request) {
        if (!StringUtils.isNullOrEmpty(getLoginPartyId())) {
            return "";
        }
        
        Long time_stamp = null;
        if (!StringUtils.isNullOrEmpty(request.getParameter("time_stamp"))) {
            time_stamp = Long.valueOf(request.getParameter("time_stamp"));
        }
 
        String model = request.getParameter("model");
        
        Map<String, Object> result = new HashMap<String, Object>();
        
        if (!StringUtils.isNullOrEmpty(model)) {
            result.put("tipList", tipService.cacheNewTipsByModel(this.getUsername_login(), time_stamp, model));
        } else {
            result.put("tipList", tipService.cacheNewTips(this.getUsername_login(), time_stamp));
        }
 
        return JsonUtils.getJsonString(result);
    }
 
    public void setTipService(TipService tipService) {
        this.tipService = tipService;
    }
}