From 2377c50187e1e844cc5be8e5b155d427585035db Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Mon, 3 Nov 2025 14:25:45 +0800 Subject: [PATCH] =?UTF-8?q?:hammer:=20=E9=94=81=E5=AE=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/user/UserUnlockRequest.java | 45 ++++++++++++ .../module/infra/entity/vo/UserLockedVO.java | 68 +++++++++++++++++++ .../service/SystemUserManagementService.java | 23 +++++++ 3 files changed, 136 insertions(+) create mode 100644 orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/request/user/UserUnlockRequest.java create mode 100644 orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/vo/UserLockedVO.java diff --git a/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/request/user/UserUnlockRequest.java b/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/request/user/UserUnlockRequest.java new file mode 100644 index 00000000..c07e4c02 --- /dev/null +++ b/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/request/user/UserUnlockRequest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 - present Dromara, All rights reserved. + * + * https://visor.dromara.org + * https://visor.dromara.org.cn + * https://visor.orionsec.cn + * + * Members: + * Jiahang Li - ljh1553488six@139.com - author + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.dromara.visor.module.infra.entity.request.user; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 用户解锁请求 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023/7/17 12:19 + */ +@Data +@Schema(name = "UserUnlockRequest", description = "用户解锁请求") +public class UserUnlockRequest { + + @NotBlank + @Schema(description = "用户名") + private String username; + +} diff --git a/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/vo/UserLockedVO.java b/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/vo/UserLockedVO.java new file mode 100644 index 00000000..167abe25 --- /dev/null +++ b/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/entity/vo/UserLockedVO.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 - present Dromara, All rights reserved. + * + * https://visor.dromara.org + * https://visor.dromara.org.cn + * https://visor.orionsec.cn + * + * Members: + * Jiahang Li - ljh1553488six@139.com - author + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.dromara.visor.module.infra.entity.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户锁定 响应对象 + * + * @author Jiahang Li + * @version 1.0.0 + * @since 2023-7-13 18:42 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "UserLockedVO", description = "用户锁定 响应对象") +public class UserLockedVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @Schema(description = "用户名") + private String username; + + @Schema(description = "失效时间") + private Long expireTime; + + @Schema(description = "请求ip") + private String address; + + @Schema(description = "请求地址") + private String location; + + @Schema(description = "userAgent") + private String userAgent; + + @Schema(description = "登录时间") + private Date loginTime; + +} diff --git a/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/service/SystemUserManagementService.java b/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/service/SystemUserManagementService.java index bf201087..3e62691f 100644 --- a/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/service/SystemUserManagementService.java +++ b/orion-visor-modules/orion-visor-module-infra/orion-visor-module-infra-service/src/main/java/org/dromara/visor/module/infra/service/SystemUserManagementService.java @@ -23,6 +23,8 @@ package org.dromara.visor.module.infra.service; import org.dromara.visor.module.infra.entity.request.user.UserSessionOfflineRequest; +import org.dromara.visor.module.infra.entity.request.user.UserUnlockRequest; +import org.dromara.visor.module.infra.entity.vo.UserLockedVO; import org.dromara.visor.module.infra.entity.vo.UserSessionVO; import java.util.List; @@ -44,6 +46,27 @@ public interface SystemUserManagementService { */ Integer getUserSessionCount(Long userId); + /** + * 获取锁定的用户列表 + * + * @return list + */ + List getLockedUserList(); + + /** + * 解锁用户 + * + * @param request request + */ + void unlockLockedUser(UserUnlockRequest request); + + /** + * 获取全部用户会话列表 + * + * @return list + */ + List getUsersSessionList(); + /** * 获取用户会话列表 *