All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lx.boot.log.ServerLogController Maven / Gradle / Ivy

Go to download

使用文档: https://a7fi97h1rc.feishu.cn/docx/X3LRdtLhkoXQ8hxgXDQc2CLOnEg?from=from_copylink

There is a newer version: 1.1
Show newest version
package com.lx.boot.log;

import com.lx.boot.OS;
import com.lx.boot.es.ElasticLowerClient;
import com.lx.boot.web.annotation.Auth;
import com.lx.constant.DefaultBaseConstant;
import com.lx.entity.Result;
import com.lx.util.LX;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//说明: 查询日志
/**{ ylx } 2022/4/2 13:38 */
@Slf4j
@Hidden
@RestController
@RequestMapping("/serverlog")
public class ServerLogController {

    @GetMapping("/query")
    @Auth(isSysMethod = true)
    public Result query(String url , String queryStr) {
        if(LX.isEmpty(url) || url.contains("?") || LX.isEmpty(OS.getProperty(DefaultBaseConstant.ES_HOSTS))){
            return Result.ok();
        }
        return Result.ok(ElasticLowerClient.getInstance(OS.getProperty(DefaultBaseConstant.ES_HOSTS),OS.getProperty(DefaultBaseConstant.ES_USERNAME,""),OS.getProperty(DefaultBaseConstant.ES_PASSWORD,"")).query(queryStr, url));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy