forked from kidgrow-microservices-platform

zhaoxiaohao
2020-11-16 644b8469f2f67cec36b35d4baf7076e3f6c36384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.kidgrow.log.controller;
 
import com.alibaba.fastjson.JSONObject;
import com.kidgrow.common.model.PageResult;
import com.kidgrow.searchcenter.client.service.IQueryService;
import com.kidgrow.searchcenter.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;
 
/**
 * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
 *
 * @Description: 审计日志<br>
 * @Project: <br>
 * @CreateDate: Created in 2020/2/24 11:23 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 */
@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);
    }
}