前后端分目录
This commit is contained in:
21
ddp/ddp-monitor/pom.xml
Normal file
21
ddp/ddp-monitor/pom.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ddp</artifactId>
|
||||
<groupId>com.fibo.ddp</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ddp-monitor</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fibo.ddp</groupId>
|
||||
<artifactId>ddp-common-service</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.fibo.ddp.monitor.controller.decisionflow;
|
||||
|
||||
import com.fibo.ddp.common.service.monitor.decisionflow.IMonitorService;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class MonitorCenterFactory implements ApplicationContextAware{
|
||||
private static Map<String, IMonitorService> monitorCenterDiffStorageBeanMap;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
Map<String,IMonitorService> map = applicationContext.getBeansOfType(IMonitorService.class);
|
||||
monitorCenterDiffStorageBeanMap = new HashMap<>();
|
||||
map.forEach((key,value)->monitorCenterDiffStorageBeanMap.put(value.getStorageType(),value));
|
||||
}
|
||||
|
||||
public static <T extends IMonitorService> T getMonitorCenterServiceImp(String storageType){
|
||||
return (T)monitorCenterDiffStorageBeanMap.get(storageType);
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,106 @@
|
||||
package com.fibo.ddp.monitor.controller.logger;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fibo.ddp.common.model.authx.system.SysUser;
|
||||
import com.fibo.ddp.common.model.common.ResponseEntityBuilder;
|
||||
import com.fibo.ddp.common.model.common.ResponseEntityDto;
|
||||
import com.fibo.ddp.common.model.monitor.logger.Logger;
|
||||
import com.fibo.ddp.common.model.monitor.logger.request.LoggerParam;
|
||||
import com.fibo.ddp.common.service.common.SessionManager;
|
||||
import com.fibo.ddp.common.service.monitor.logger.LogService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller("loggerControllerV2")
|
||||
@RequestMapping("v2/sysLog")
|
||||
@ResponseBody
|
||||
public class LoggerController {
|
||||
|
||||
@Autowired
|
||||
private LogService loggerService;
|
||||
|
||||
/**
|
||||
* @api {POST} /v2/sysLog/getLogList 6.51. 获取日志列表
|
||||
* @apiGroup sysManager
|
||||
* @apiVersion 2.0.0
|
||||
* @apiParam {Integer} pageNo 页数
|
||||
* @apiParam {Integer} pageSize 每页的条数
|
||||
* @apiParam {String} searchKey 搜索关键字
|
||||
* @apiParam {String} startDate 搜索开始时间
|
||||
* @apiParam {String} endDate 搜索结束时间
|
||||
* @apiSuccess {JSON} pager 分页信息
|
||||
* @apiSuccess {JSONArray} logList 日志列表
|
||||
* @apiSuccess (logList) {Long} userId 日志Id
|
||||
* @apiSuccess (logList) {String} opType 操作类型
|
||||
* @apiSuccess (logList) {String} organName 公司名称
|
||||
* @apiSuccess (logList) {String} opName 操作名称
|
||||
* @apiSuccess (logList) {Long} opUserId 操作人员id
|
||||
* @apiSuccess (logList) {String} opUserName 操作人员名称
|
||||
* @apiSuccess (logList) {Long} organId 组织id
|
||||
* @apiSuccess (logList) {String} method 方法名
|
||||
* @apiSuccess (logList) {String} requestPath 请求地址
|
||||
* @apiSuccess (logList) {String} requestParam 请求参数
|
||||
* @apiSuccess (logList) {String} responseParam 响应参数
|
||||
* @apiSuccess (logList) {String} ip 请求ip
|
||||
* @apiSuccess (logList) {Long} startTime 开始时间
|
||||
* @apiSuccess (logList) {Long} endTime 结束时间
|
||||
* @apiParamExample {json} 请求示例:
|
||||
* {"pageNo":1,"pageSize":2,"searchKey":"修改","startDate":"2021-3-11","endDate":"2021-3-21"}
|
||||
* @apiSuccessExample {json} Success-Response:
|
||||
* {"status":"1","error":"00000000","msg":null,"data":{"pager":{"pageNum":1,"pageSize":2,"size":2,"startRow":1,"endRow":2,"total":283,"pages":142,"list":null,"prePage":0,"nextPage":2,"isFirstPage":true,"isLastPage":false,"hasPreviousPage":false,"hasNextPage":true,"navigatePages":8,"navigatepageNums":[1,2,3,4,5,6,7,8],"navigateFirstPage":1,"navigateLastPage":8,"firstPage":1,"lastPage":8},"logList":[{"userId":5345,"opType":"updateSysMenu","organName":"rik","opName":"修改系统菜单","opUserId":1,"opUserName":"超级管理员","organId":1,"method":"update","requestPath":"http://localhost:8080/Riskmanage/v2/sysMenu/update","requestParam":"}","responseParam":"ResponseEntityDto(super=com.risk.riskmanage.common.model.ResponseEntityDto@8bc7d62e, status=1, error=00000000, msg=null, data=1)","ip":"0:0:0:0:0:0:0:1","startTime":1616251925000,"endTime":1616251938000},{"userId":5342,"opType":"updateOrgan","organName":"rik","opName":" 修改组织信息","opUserId":1,"opUserName":"超级管理员","organId":1,"method":"update","requestPath":"http://localhost:8080/Riskmanage/v2/sysOrganization/update","requestParam":"}","responseParam":"ResponseEntityDto(super=com.risk.riskmanage.common.model.ResponseEntityDto@8bc7d62e, status=1, error=00000000, msg=null, data=1)","ip":"0:0:0:0:0:0:0:1","startTime":1616234345000,"endTime":1616234352000}]}}
|
||||
*/
|
||||
@RequestMapping(value = "getLogList", method = RequestMethod.POST)
|
||||
public ResponseEntityDto getLogList(@RequestBody LoggerParam loggerParam){
|
||||
Map<String,Object> param = JSONObject.parseObject(JSONObject.toJSONString(loggerParam), Map.class);
|
||||
SysUser sysUser = SessionManager.getLoginAccount();
|
||||
if(!sysUser.getNickName().equals("超级管理员")){
|
||||
param.put("organId", sysUser.getOrganId());
|
||||
}
|
||||
PageHelper.startPage(loggerParam.getPageNo(), loggerParam.getPageSize());
|
||||
List<Logger> logList = loggerService.getLogList(param);
|
||||
PageInfo<Logger> pageInfo = new PageInfo<Logger>(logList);
|
||||
pageInfo.setList(null);
|
||||
HashMap<String, Object> modelMap = new HashMap<>();
|
||||
modelMap.put("pager", pageInfo);
|
||||
modelMap.put("logList", logList);
|
||||
return ResponseEntityBuilder.buildNormalResponse(modelMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {POST} /v2/sysLog/getLogInfo/{userId} 6.52. 获取日志详情
|
||||
* @apiGroup sysManager
|
||||
* @apiVersion 2.0.0
|
||||
* @apiParam {Long} userId 日志Id(url参数)
|
||||
* @apiSuccess {Long} userId 日志Id
|
||||
* @apiSuccess {String} opType 操作类型
|
||||
* @apiSuccess {String} organName 公司名称
|
||||
* @apiSuccess {String} opName 操作名称
|
||||
* @apiSuccess {Long} opUserId 操作人员id
|
||||
* @apiSuccess {String} opUserName 操作人员名称
|
||||
* @apiSuccess {Long} organId 组织id
|
||||
* @apiSuccess {String} method 方法名
|
||||
* @apiSuccess {String} requestPath 请求地址
|
||||
* @apiSuccess {String} requestParam 请求参数
|
||||
* @apiSuccess {String} responseParam 响应参数
|
||||
* @apiSuccess {String} ip 请求ip
|
||||
* @apiSuccess {Long} startTime 开始时间
|
||||
* @apiSuccess {Long} endTime 结束时间
|
||||
* @apiParamExample {json} 请求示例:
|
||||
* {}
|
||||
* @apiSuccessExample {json} 成功返回数据示例:
|
||||
* {"status":"1","error":"00000000","msg":null,"data":{"userId":5342,"opType":"updateOrgan","organName":"rik","opName":" 修改组织信息","opUserId":1,"opUserName":"超级管理员","organId":1,"method":"update","requestPath":"http://localhost:8080/Riskmanage/v2/sysOrganization/update","requestParam":"}","responseParam":"ResponseEntityDto(super=com.risk.riskmanage.common.model.ResponseEntityDto@8bc7d62e, status=1, error=00000000, msg=null, data=1)","ip":"0:0:0:0:0:0:0:1","startTime":1616234345000,"endTime":1616234352000}}
|
||||
*/
|
||||
@RequestMapping(value = "getLogInfo/{id}", method = RequestMethod.POST)
|
||||
public ResponseEntityDto getLogInfo(@PathVariable Long id){
|
||||
Logger logger = loggerService.findById(id);
|
||||
return ResponseEntityBuilder.buildNormalResponse(logger);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user