添加设备log

This commit is contained in:
huangzj
2023-08-08 09:51:55 +08:00
parent 8bb82cf859
commit 0054466fd9
4 changed files with 86 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package com.njcn.system.controller;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.constant.OperateType;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.dto.LogInfoDTO;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.stream.Stream;
/**
@@ -59,10 +61,16 @@ public class UserLogController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
@PostMapping("/query")
@ApiOperation("查询审计日志")
@ApiOperation("查询审计日志(治理模块)")
public HttpResult<List<UserLog>> queryUserLog() {
String methodDescribe = getMethodDescribe("queryUserLog");
List<UserLog> list = userLogService.lambdaQuery().eq(UserLog::getLoginName, RequestUtil.getUsername()).orderByDesc(UserLog::getCreateTime).last("limit 100").list();
List<UserLog> list = userLogService.lambdaQuery().eq(UserLog::getLoginName, RequestUtil.getUsername()).
in(UserLog::getServiceName, Stream.of(ServerInfo.CS_DEVICE_BOOT,
ServerInfo.CS_HARMONIC_BOOT,
ServerInfo.CS_REPORT_BOOT,
ServerInfo.CS_EVENT_BOOT,
ServerInfo.CS_WARN_BOOT,
ServerInfo.CS_SYSTEM_BOOT)).orderByDesc(UserLog::getCreateTime).last("limit 100").list();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}