From ee8db44375c31bb6ae8c9ca40486c605a592e6b4 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 9 Jan 2024 10:49:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A5=E5=BF=97=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/menu/manage/MenuManage.java | 3 +- .../main/resources/application-standalone.yml | 2 +- .../main/resources/i18n/core_zh_CN.properties | 1 + .../main/java/io/dataease/api/log/LogApi.java | 40 +++++++++++++++++++ .../dataease/api/log/dto/LogGridRequest.java | 21 ++++++++++ .../io/dataease/api/log/vo/LogGridVO.java | 19 +++++++++ .../java/io/dataease/api/log/vo/LogOpVO.java | 20 ++++++++++ .../api/permissions/org/api/OrgApi.java | 5 +++ .../api/permissions/org/vo/OrgDetailVO.java | 20 ++++++++++ .../api/permissions/role/dto/RoleCreator.java | 4 ++ .../api/permissions/user/dto/UserCreator.java | 4 ++ .../main/java/io/dataease/constant/LogOT.java | 6 +++ .../main/java/io/dataease/constant/LogST.java | 6 +++ 13 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/log/LogApi.java create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/log/dto/LogGridRequest.java create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogGridVO.java create mode 100644 sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogOpVO.java create mode 100644 sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/vo/OrgDetailVO.java diff --git a/core/core-backend/src/main/java/io/dataease/menu/manage/MenuManage.java b/core/core-backend/src/main/java/io/dataease/menu/manage/MenuManage.java index e16ac95ec1..b5434e11c9 100644 --- a/core/core-backend/src/main/java/io/dataease/menu/manage/MenuManage.java +++ b/core/core-backend/src/main/java/io/dataease/menu/manage/MenuManage.java @@ -97,6 +97,7 @@ public class MenuManage { || coreMenu.getPid().equals(21L) || coreMenu.getId().equals(25L) || coreMenu.getId().equals(26L) - || coreMenu.getId().equals(35L); + || coreMenu.getId().equals(35L) + || coreMenu.getId().equals(40L); } } diff --git a/core/core-backend/src/main/resources/application-standalone.yml b/core/core-backend/src/main/resources/application-standalone.yml index a179fd34d0..b521aa59d0 100644 --- a/core/core-backend/src/main/resources/application-standalone.yml +++ b/core/core-backend/src/main/resources/application-standalone.yml @@ -4,7 +4,7 @@ spring: username: root password: 123456 messages: - basename: i18n/lic,i18n/core,i18n/permissions + basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack flyway: enabled: true table: de_standalone_version diff --git a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties index af0608789c..9003b1a4e8 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties @@ -61,3 +61,4 @@ i18n_table_name_repeat=\u540D\u79F0\u91CD\u590D: i18n_sql_not_empty=sql \u4E0D\u80FD\u4E3A\u7A7A i18n_menu.parameter=\u7CFB\u7EDF\u53C2\u6570 i18n_user_old_pwd_error=\u539F\u59CB\u5BC6\u7801\u9519\u8BEF +i18n_menu.toolbox-log=\u64CD\u4F5C\u65E5\u5FD7 diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/log/LogApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/log/LogApi.java new file mode 100644 index 0000000000..ee6e92907c --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/log/LogApi.java @@ -0,0 +1,40 @@ +package io.dataease.api.log; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiSupport; +import io.dataease.api.log.dto.LogGridRequest; +import io.dataease.api.log.vo.LogGridVO; +import io.dataease.api.log.vo.LogOpVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +@Tag(name = "工具箱:日志管理") +@ApiSupport(order = 2) +public interface LogApi { + + @Operation(summary = "查询日志列表") + @Parameters({ + @Parameter(name = "goPage", description = "目标页码", required = true, in = ParameterIn.PATH), + @Parameter(name = "pageSize", description = "每页容量", required = true, in = ParameterIn.PATH), + @Parameter(name = "request", description = "过滤条件", required = true) + }) + @PostMapping("/pager/{goPage}/{pageSize}") + IPage pager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody LogGridRequest request); + + @Operation(summary = "导出日志列表") + @PostMapping("/export") + void export(@RequestBody LogGridRequest request); + + @Operation(summary = "操作类型") + @GetMapping("/options") + List logOptions(); +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/log/dto/LogGridRequest.java b/sdk/api/api-base/src/main/java/io/dataease/api/log/dto/LogGridRequest.java new file mode 100644 index 0000000000..9035722cb5 --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/log/dto/LogGridRequest.java @@ -0,0 +1,21 @@ +package io.dataease.api.log.dto; + +import io.dataease.model.KeywordRequest; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +public class LogGridRequest extends KeywordRequest implements Serializable { + + private String op; + + private Long uid; + + private Long oid; + + private List time; +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogGridVO.java b/sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogGridVO.java new file mode 100644 index 0000000000..bb2665af0f --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogGridVO.java @@ -0,0 +1,19 @@ +package io.dataease.api.log.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class LogGridVO implements Serializable { + + private String opText; + + private String opDetail; + + private String name; + + private String ip; + + private Long time; +} diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogOpVO.java b/sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogOpVO.java new file mode 100644 index 0000000000..c688d28196 --- /dev/null +++ b/sdk/api/api-base/src/main/java/io/dataease/api/log/vo/LogOpVO.java @@ -0,0 +1,20 @@ +package io.dataease.api.log.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LogOpVO implements Serializable { + + private String value; + + private String label; + + private List children; +} diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/api/OrgApi.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/api/OrgApi.java index d12264f4e5..7f8ec71fe4 100644 --- a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/api/OrgApi.java +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/api/OrgApi.java @@ -5,6 +5,7 @@ import io.dataease.api.permissions.org.dto.OrgCreator; import io.dataease.api.permissions.org.dto.OrgEditor; import io.dataease.api.permissions.org.dto.OrgRequest; import io.dataease.api.permissions.org.vo.MountedVO; +import io.dataease.api.permissions.org.vo.OrgDetailVO; import io.dataease.api.permissions.org.vo.OrgPageVO; import io.dataease.auth.DeApiPath; import io.dataease.auth.DePermit; @@ -56,4 +57,8 @@ public interface OrgApi { @Operation(summary = "", hidden = true) @GetMapping("/resourceExist/{oid}") boolean resourceExist(@PathVariable("oid") Long oid); + + @Operation(hidden = true) + @GetMapping("/detail/{oid}") + OrgDetailVO detail(@PathVariable("oid") Long oid); } diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/vo/OrgDetailVO.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/vo/OrgDetailVO.java new file mode 100644 index 0000000000..bdf8c1c409 --- /dev/null +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/org/vo/OrgDetailVO.java @@ -0,0 +1,20 @@ +package io.dataease.api.permissions.org.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class OrgDetailVO { + + private Long id; + + private String name; + + private Long pid; + + private String rootPath; + +} diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/role/dto/RoleCreator.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/role/dto/RoleCreator.java index a348c82a6a..a9add0facd 100644 --- a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/role/dto/RoleCreator.java +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/role/dto/RoleCreator.java @@ -1,5 +1,6 @@ package io.dataease.api.permissions.role.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -17,6 +18,9 @@ public class RoleCreator implements Serializable { private Integer typeCode; @Schema(description = "描述", hidden = true) private String desc; + @JsonIgnore + @Schema(hidden = true) + private Long rid; } diff --git a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java index 7535d3c82c..e97d13e952 100644 --- a/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java +++ b/sdk/api/api-permissions/src/main/java/io/dataease/api/permissions/user/dto/UserCreator.java @@ -1,5 +1,6 @@ package io.dataease.api.permissions.user.dto; +import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -27,4 +28,7 @@ public class UserCreator implements Serializable { private List roleIds; @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) private Boolean enable; + @Schema(hidden = true) + @JsonIgnore + private Long uid; } diff --git a/sdk/common/src/main/java/io/dataease/constant/LogOT.java b/sdk/common/src/main/java/io/dataease/constant/LogOT.java index 62580a9356..512da3434c 100644 --- a/sdk/common/src/main/java/io/dataease/constant/LogOT.java +++ b/sdk/common/src/main/java/io/dataease/constant/LogOT.java @@ -1,5 +1,7 @@ package io.dataease.constant; +import java.util.Arrays; + public enum LogOT { CREATE(1, "OPERATE_TYPE_CREATE"), MODIFY(2, "OPERATE_TYPE_MODIFY"), @@ -23,6 +25,10 @@ public enum LogOT { this.name = name; } + public static LogOT fromValue(Integer value) { + return Arrays.stream(values()).filter(v -> v.value.equals(value)).findFirst().get(); + } + public Integer getValue() { return value; } diff --git a/sdk/common/src/main/java/io/dataease/constant/LogST.java b/sdk/common/src/main/java/io/dataease/constant/LogST.java index 930ba0ea7d..4a938bdfab 100644 --- a/sdk/common/src/main/java/io/dataease/constant/LogST.java +++ b/sdk/common/src/main/java/io/dataease/constant/LogST.java @@ -1,5 +1,7 @@ package io.dataease.constant; +import java.util.Arrays; + public enum LogST { PANEL(1, "SOURCE_TYPE_PANEL"), SCREEN(2, "SOURCE_TYPE_SCREEN"), @@ -31,6 +33,10 @@ public enum LogST { this.name = name; } + public static LogST fromValue(Integer value) { + return Arrays.stream(values()).filter(v -> v.value.equals(value)).findFirst().get(); + } + LogST() { } }