package com.moral.monitor.controller; import com.moral.monitor.entity.Equipment; import com.moral.monitor.service.WeChatService; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import java.util.Map; /** * Created by a on 2017/5/26. */ @Controller public class WeChatController { @Resource WeChatService weChatService; @RequestMapping("/detail") public ModelAndView weiXindetail(String mac, long time, String level ){ Equipment equipment = weChatService.weiXindetail(mac); if (equipment==null){ return null; } Map wxmap = weChatService.wxMap(mac, time); ModelAndView modelAndView = new ModelAndView(); modelAndView.addObject("equipment", equipment); modelAndView.addObject("time", time); modelAndView.addObject("level", level); modelAndView.addObject("wxmap",wxmap); modelAndView.setViewName("weixin"); return modelAndView; } }