Skip to content

Commit

Permalink
feat: update log export
Browse files Browse the repository at this point in the history
  • Loading branch information
wtt40122 committed Jul 3, 2023
1 parent 4aac83b commit 50b8b8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ public Boolean createIndex(@RequestParam(value = "templateName") String template

@RequestMapping(path = "/log/export", method = "get")
public void logExport(@RequestParam(value = "logstore") String logstore,
@RequestParam(value = "storeId") Long storeId,
@RequestParam(value = "tail") String tail,
@RequestParam(value = "startTime") Long startTime,
@RequestParam(value = "endTime") Long endTime,
@RequestParam(value = "fullTextSearch") String fullTextSearch) throws Exception {
LogQuery logQuery = new LogQuery(logstore, tail, startTime, endTime, fullTextSearch, "timestamp");
LogQuery logQuery = new LogQuery(logstore, storeId, tail, startTime, endTime, fullTextSearch, "timestamp");
esDataService.logExport(logQuery);
}

Expand Down Expand Up @@ -190,7 +191,7 @@ public void showLogCountCache() throws IOException {
@RequestMapping(path = "/log/save/list", method = "get")
public Result<List<SearchSaveDTO>> searchSavelList(@RequestParam(value = "storeId") Long storeId,
@RequestParam(value = "sort") Integer sort) {
return searchSaveService.list(storeId,sort);
return searchSaveService.list(storeId, sort);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ public void downLogFile(HSSFWorkbook excel, String fileName) throws IOException
fos = new FileOutputStream(file);
excel.write(fos);
Down.down(fileName);
} catch (Exception e) {
log.error("downLogFile error,fileName:{}", fileName, e);
} finally {
if (excel != null) {
excel.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public class LogQuery implements Serializable {
public LogQuery() {
}

public LogQuery(String logstore, String tail, Long startTime, Long endTime, String fullTextSearch, String sortKey) {
public LogQuery(String logstore, Long storeId, String tail, Long startTime, Long endTime, String fullTextSearch, String sortKey) {
this.logstore = logstore;
this.storeId = storeId;
this.tail = tail;
this.startTime = startTime;
this.endTime = endTime;
Expand Down

0 comments on commit 50b8b8b

Please sign in to comment.