73 lines
2.1 KiB
Java
73 lines
2.1 KiB
Java
|
|
package com.saye.hospitalgd.controller.system;
|
||
|
|
|
||
|
|
import java.util.HashMap;
|
||
|
|
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Controller;
|
||
|
|
import org.springframework.ui.ModelMap;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||
|
|
|
||
|
|
import com.github.pagehelper.PageHelper;
|
||
|
|
import com.github.pagehelper.PageInfo;
|
||
|
|
import com.saye.hospitalgd.commons.log.ExceptionDUtil;
|
||
|
|
import com.saye.hospitalgd.commons.log.LogUtil;
|
||
|
|
import com.saye.hospitalgd.model.Logger;
|
||
|
|
import com.saye.hospitalgd.service.system.LoggerService;
|
||
|
|
|
||
|
|
@Controller
|
||
|
|
public class LoggerController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private LoggerService loggerService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @description 到日志管理页面
|
||
|
|
* @author thuang
|
||
|
|
* @created 2019年11月13日 下午5:27:29
|
||
|
|
* @param modelMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
@RequestMapping("/toLogger")
|
||
|
|
public String toLogger(ModelMap modelMap){
|
||
|
|
|
||
|
|
return "system/logger";
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @description 查询所有日志数据
|
||
|
|
* @author thuang
|
||
|
|
* @created 2019年11月13日 下午5:41:56
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
@RequestMapping("/findLogger")
|
||
|
|
@ResponseBody
|
||
|
|
public HashMap<String, Object> findLogger(String loggerType,String startTime,String endTime,Integer page,Integer limit ){
|
||
|
|
HashMap<Object, Object> map=new HashMap<Object, Object>();
|
||
|
|
map.put("loggerType", loggerType);
|
||
|
|
map.put("startTime", startTime);
|
||
|
|
map.put("endTime", endTime);
|
||
|
|
|
||
|
|
HashMap<String, Object> responseMap = new HashMap<String,Object>();
|
||
|
|
try {
|
||
|
|
PageHelper.startPage(page, limit);
|
||
|
|
// PageInfo<HashMap<Object, Object>> appsPageInfo = new PageInfo<HashMap<Object,Object>>(loggerService.hospitalgd(map));
|
||
|
|
|
||
|
|
PageInfo<Logger> appsPageInfo = new PageInfo<Logger>(loggerService.findLogger(map));
|
||
|
|
|
||
|
|
responseMap.put("code", 0);
|
||
|
|
responseMap.put("msg", "");
|
||
|
|
responseMap.put("count", appsPageInfo.getTotal());
|
||
|
|
responseMap.put("data", appsPageInfo.getList());
|
||
|
|
} catch (Exception e) {
|
||
|
|
|
||
|
|
e.printStackTrace();
|
||
|
|
LogUtil.error(this.getClass(), "查询所有日志数据失败,原因:"+ExceptionDUtil.getDetailExceptionMsg(e));
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return responseMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|