From feab3f2bc783b71541ac53512a692c71a18b191b Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期六, 14 九月 2024 11:28:30 +0800 Subject: [PATCH] 应用管理、租户管理、菜单权限管理等修改 --- iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppApi.java | 31 +++++++ iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppRespDTO.java | 75 ++++++++++++++++++ iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppMenuApi.java | 32 ++++++++ iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuRespDTO.java | 80 ++++++++++++++++++++ iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuSimpleRespDTO.java | 22 +++++ 5 files changed, 240 insertions(+), 0 deletions(-) diff --git a/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppApi.java b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppApi.java new file mode 100644 index 0000000..ff3c870 --- /dev/null +++ b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppApi.java @@ -0,0 +1,31 @@ +package com.iailab.module.system.api.app; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.module.system.api.app.dto.AppMenuRespDTO; +import com.iailab.module.system.api.app.dto.AppRespDTO; +import com.iailab.module.system.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +@FeignClient(name = ApiConstants.NAME) +@Tag(name = "RPC 服务 - 应用菜单") +public interface AppApi { + + String PREFIX = ApiConstants.PREFIX + "/app"; + +// @GetMapping(PREFIX + "/get-menu") +// @Operation(summary = "获得应用信息") +// @Parameter(name = "id", description = "应用编号", example = "1024", required = true) +// CommonResult<List<AppMenuRespDTO>> getAppMenuList(@RequestParam("id") Long id); + + @GetMapping(PREFIX + "/list") + @Operation(summary = "获得应用菜单列表") + CommonResult<List<AppRespDTO>> getAppList(); + +} diff --git a/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppMenuApi.java b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppMenuApi.java new file mode 100644 index 0000000..66adc90 --- /dev/null +++ b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/AppMenuApi.java @@ -0,0 +1,32 @@ +package com.iailab.module.system.api.app; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.module.system.api.app.dto.AppMenuRespDTO; +import com.iailab.module.system.api.app.dto.AppRespDTO; +import com.iailab.module.system.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@FeignClient(name = ApiConstants.NAME) +@Tag(name = "RPC 服务 - 应用菜单") +public interface AppMenuApi { + + String PREFIX = ApiConstants.PREFIX + "/app-menu"; + + @GetMapping(PREFIX + "/get-menu") + @Operation(summary = "获得应用信息") + @Parameter(name = "id", description = "应用编号", example = "1024", required = true) + CommonResult<List<AppMenuRespDTO>> getAppMenuList(@RequestParam("id") Long id); + + @GetMapping(PREFIX + "/list") + @Operation(summary = "获得应用菜单列表") + CommonResult<List<AppRespDTO>> getAppList(); + +} diff --git a/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuRespDTO.java b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuRespDTO.java new file mode 100644 index 0000000..855e543 --- /dev/null +++ b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuRespDTO.java @@ -0,0 +1,80 @@ +package com.iailab.module.system.api.app.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.time.LocalDateTime; +import java.util.List; + +@Schema(description = "RPC 服务 - 应用菜单 Response DTO") +@Data +public class AppMenuRespDTO { + + @Schema(description = "菜单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + private Long id; + + @Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "平台") + @NotBlank(message = "菜单名称不能为空") + @Size(max = 50, message = "菜单名称长度不能超过50个字符") + private String name; + + @Schema(description = "权限标识,仅菜单类型为按钮时,才需要传递", example = "sys:menu:add") + @Size(max = 100) + private String permission; + + @Schema(description = "类型,参见 MenuTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "菜单类型不能为空") + private Integer type; + + @Schema(description = "显示顺序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + @NotNull(message = "显示顺序不能为空") + private Integer sort; + + @Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + @NotNull(message = "父菜单 ID 不能为空") + private Long parentId; + + @Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post") + @Size(max = 200, message = "路由地址不能超过200个字符") + private String path; + + @Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list") + private String icon; + + @Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index") + @Size(max = 200, message = "组件路径不能超过255个字符") + private String component; + + @Schema(description = "组件名", example = "SystemUser") + private String componentName; + + @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态不能为空") + private Integer status; + + @Schema(description = "是否可见", example = "false") + private Boolean visible; + + @Schema(description = "是否缓存", example = "false") + private Boolean keepAlive; + + @Schema(description = "是否总是显示", example = "false") + private Boolean alwaysShow; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式") + private LocalDateTime createTime; + + /** + * 应用类型(1-系统菜单, 2-应用菜单) + */ + private Integer appType; + + /** + * 子路由 + */ + private List<AppMenuRespDTO> children; + +} diff --git a/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuSimpleRespDTO.java b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuSimpleRespDTO.java new file mode 100644 index 0000000..91f8b0f --- /dev/null +++ b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppMenuSimpleRespDTO.java @@ -0,0 +1,22 @@ +package com.iailab.module.system.api.app.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "应用菜单精简信息 Response VO") +@Data +public class AppMenuSimpleRespDTO { + + @Schema(description = "菜单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + private Long id; + + @Schema(description = "菜单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "平台") + private String name; + + @Schema(description = "父菜单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + private Long parentId; + + @Schema(description = "类型,参见 MenuTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + private Integer type; + +} diff --git a/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppRespDTO.java b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppRespDTO.java new file mode 100644 index 0000000..88a7a23 --- /dev/null +++ b/iailab-module-system/iailab-module-system-api/src/main/java/com/iailab/module/system/api/app/dto/AppRespDTO.java @@ -0,0 +1,75 @@ +package com.iailab.module.system.api.app.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年08月18日 + */ +@Schema(description = "管理后台 - 应用 Response VO") +@Data +public class AppRespDTO { + + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + private Long id; + + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用编号") + private String appCode; + + @Schema(description = "应用名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用名称") + private String appName; + + @Schema(description = "应用域名", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用域名") + private String appDomain; + + @Schema(description = "接口域名", requiredMode = Schema.RequiredMode.REQUIRED, example = "接口域名") + private String apiDomain; + + @Schema(description = "应用账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用账号") + private String appKey; + + @Schema(description = "应用密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用密码") + private String appSecret; + + @Schema(description = "应用分组", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用分组") + private String appGroup; + + @Schema(description = "应用加载类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用加载类型") + private Integer loadType; + + @Schema(description = "应用图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用图标") + private String icon; + + @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "排序") + private Integer orderNum; + + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "状态") + private Integer status; + + @Schema(description = "开发者ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "开发者ID") + private String devId; + + @Schema(description = "开发者名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "开发者名称") + private String devName; + + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "备注") + private String remark; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime createTime; + + @Schema(description = "租户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "租户ID") + private Long tenantId; + + @Schema(description = "应用菜单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "应用菜单ID") + private Long appMenuId; + + /** + * 应用类型(1-系统菜单, 2-应用菜单) + */ + private Integer appType; +} -- Gitblit v1.9.3