新增审计日志功能(支持spEL表达式)

This commit is contained in:
zlt
2020-02-04 17:35:47 +08:00
parent 5167a6b54f
commit 4d27926ee0
17 changed files with 485 additions and 11 deletions
@@ -0,0 +1,42 @@
package com.central.log.controller;
import com.alibaba.fastjson.JSONObject;
import com.central.common.model.PageResult;
import com.central.search.client.service.IQueryService;
import com.central.search.model.SearchDto;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 审计日志
*
* @author zlt
* @date 2020/2/4
* <p>
* Blog: https://blog.csdn.net/zlt2000
* Github: https://github.com/zlt2000
*/
@RestController
public class AuditLogController {
private final IQueryService queryService;
public AuditLogController(IQueryService queryService) {
this.queryService = queryService;
}
@ApiOperation(value = "审计日志全文搜索列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "queryStr", value = "搜索关键字", dataType = "String")
})
@GetMapping(value = "/auditLog")
public PageResult<JSONObject> getPage(SearchDto searchDto) {
searchDto.setIsHighlighter(true);
searchDto.setSortCol("timestamp");
return queryService.strQuery("audit-log-*", searchDto);
}
}