feature(web): 增加独立小工具

直接通过HDFS查询时间线,有时候保留现场会直接copy一个hdfs目录,不遵循生产表的逻辑,只能通过hdfs路经查询
This commit is contained in:
2023-07-04 20:09:49 +08:00
parent 07200b890f
commit fb231805c2
5 changed files with 152 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
package com.lanyuanxiaoyao.service.web.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.lanyuanxiaoyao.service.configuration.entity.AmisResponse;
import com.lanyuanxiaoyao.service.configuration.entity.PageResponse;
import com.lanyuanxiaoyao.service.configuration.entity.hudi.HudiInstant;
@@ -67,4 +68,38 @@ public class HudiController extends BaseController {
PageResponse<HudiInstant> response = hudiService.timelineList(queryMap);
return responseCrudData(response.getData(), response.getTotal());
}
@GetMapping("/timeline/list_hdfs")
public AmisResponse timelineHdfs(
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "count", defaultValue = "10") Integer count,
@RequestParam(value = "order", defaultValue = "timestamp") String order,
@RequestParam(value = "direction", defaultValue = "desc") String direction,
@RequestParam("hdfs") String hdfs,
@RequestParam(value = "filter_type", required = false) List<String> filterType,
@RequestParam(value = "filter_action", required = false) List<String> filterAction,
@RequestParam(value = "filter_state", required = false) List<String> filterState
) {
MutableMap<String, Object> queryMap = Maps.mutable.empty();
queryMap.put("page", page);
queryMap.put("count", count);
if (StrUtil.isNotBlank(order) && StrUtil.isNotBlank(direction)) {
queryMap.put("order", order);
queryMap.put("direction", direction);
}
if (ObjectUtil.isNotEmpty(hdfs)) {
queryMap.put("hdfs", hdfs);
}
if (ObjectUtil.isNotEmpty(filterType)) {
queryMap.put("filter_type", filterType);
}
if (ObjectUtil.isNotEmpty(filterAction)) {
queryMap.put("filter_action", filterAction);
}
if (ObjectUtil.isNotEmpty(filterState)) {
queryMap.put("filter_state", filterState);
}
PageResponse<HudiInstant> response = hudiService.timelineHdfsList(queryMap);
return responseCrudData(response.getData(), response.getTotal());
}
}