rev:日志修改(未完成)
This commit is contained in:
@@ -5,8 +5,6 @@ import cn.hutool.http.HttpUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.loki.service.LokiService;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,13 +14,12 @@ import org.springframework.stereotype.Service;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class LokiServiceImpl implements LokiService {
|
public class LokiServiceImpl {
|
||||||
|
|
||||||
private String lokiUrl;
|
private String lokiUrl;
|
||||||
|
|
||||||
private String systemName;
|
private String systemName;
|
||||||
|
|
||||||
@Override
|
|
||||||
public JSONObject getLogData(JSONObject json) {
|
public JSONObject getLogData(JSONObject json) {
|
||||||
String logLabel = "";
|
String logLabel = "";
|
||||||
String logLabelValue = "";
|
String logLabelValue = "";
|
||||||
@@ -68,7 +65,6 @@ public class LokiServiceImpl implements LokiService {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public JSONArray getLabelsValues() {
|
public JSONArray getLabelsValues() {
|
||||||
/**
|
/**
|
||||||
* [{
|
* [{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.lucene.common.Searcher;
|
|
||||||
import org.nl.modules.lucene.service.LuceneService;
|
import org.nl.modules.lucene.service.LuceneService;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -30,7 +29,6 @@ public class LuceneServiceImpl implements LuceneService {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public JSONArray getLabelsValues() {
|
public JSONArray getLabelsValues() {
|
||||||
JSONArray result = new JSONArray();
|
JSONArray result = new JSONArray();
|
||||||
// 获取所有标签
|
// 获取所有标签
|
||||||
@@ -64,7 +62,7 @@ public class LuceneServiceImpl implements LuceneService {
|
|||||||
public Map<String, Object> getAll(Map whereJson, Pageable page) {
|
public Map<String, Object> getAll(Map whereJson, Pageable page) {
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
try {
|
try {
|
||||||
JSONObject jsonObject = (JSONObject) Searcher.search(luceneUrl, "", whereJson);
|
JSONObject jsonObject = null;//(JSONObject) Searcher.search(luceneUrl, "", whereJson);
|
||||||
JSONArray array = jsonObject.getJSONArray("content");
|
JSONArray array = jsonObject.getJSONArray("content");
|
||||||
int totalElements = Integer.parseInt(jsonObject.get("totalElements").toString());
|
int totalElements = Integer.parseInt(jsonObject.get("totalElements").toString());
|
||||||
jo.put("content", array);
|
jo.put("content", array);
|
||||||
|
|||||||
Reference in New Issue
Block a user