feat(新增): 强制用户下线
This commit is contained in:
parent
f73a3e539a
commit
4c9db97991
|
@ -28,8 +28,5 @@ public class DeptAddDto {
|
||||||
@Schema(name = "summary", title = "部门简介")
|
@Schema(name = "summary", title = "部门简介")
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
@Schema(name = "remarks", title = "备注信息")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,5 @@ public class DeptDto {
|
||||||
@Schema(name = "summary", title = "部门简介")
|
@Schema(name = "summary", title = "部门简介")
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
@Schema(name = "remarks", title = "备注信息")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,5 @@ public class DeptUpdateDto {
|
||||||
@Schema(name = "summary", title = "部门简介")
|
@Schema(name = "summary", title = "部门简介")
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
@Schema(name = "remarks", title = "备注信息")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@ import lombok.NoArgsConstructor;
|
||||||
@Schema(name = "MenuIconAddDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
@Schema(name = "MenuIconAddDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
||||||
public class MenuIconAddDto {
|
public class MenuIconAddDto {
|
||||||
|
|
||||||
|
@Schema(name = "iconCode", title = "icon类名")
|
||||||
|
@NotBlank(message = "iconCode不能为空")
|
||||||
|
private String iconCode;
|
||||||
|
|
||||||
@Schema(name = "iconName", title = "icon 名称")
|
@Schema(name = "iconName", title = "icon 名称")
|
||||||
@NotBlank(message = "icon 名称不能为空")
|
@NotBlank(message = "icon 名称不能为空")
|
||||||
private String iconName;
|
private String iconName;
|
||||||
|
|
|
@ -13,6 +13,9 @@ import lombok.NoArgsConstructor;
|
||||||
@Schema(name = "MenuIconDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
@Schema(name = "MenuIconDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
||||||
public class MenuIconDto {
|
public class MenuIconDto {
|
||||||
|
|
||||||
|
@Schema(name = "iconCode", title = "icon类名")
|
||||||
|
private String iconCode;
|
||||||
|
|
||||||
@Schema(name = "iconName", title = "icon 名称")
|
@Schema(name = "iconName", title = "icon 名称")
|
||||||
private String iconName;
|
private String iconName;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,10 @@ public class MenuIconUpdateDto {
|
||||||
@NotNull(message = "id不能为空")
|
@NotNull(message = "id不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(name = "iconCode", title = "icon类名")
|
||||||
|
@NotBlank(message = "iconCode不能为空")
|
||||||
|
private String iconCode;
|
||||||
|
|
||||||
@Schema(name = "iconName", title = "icon 名称")
|
@Schema(name = "iconName", title = "icon 名称")
|
||||||
@NotBlank(message = "icon 名称不能为空")
|
@NotBlank(message = "icon 名称不能为空")
|
||||||
private String iconName;
|
private String iconName;
|
||||||
|
|
|
@ -34,8 +34,5 @@ public class Dept extends BaseEntity {
|
||||||
@Schema(name = "summary", title = "部门简介")
|
@Schema(name = "summary", title = "部门简介")
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
@Schema(name = "remarks", title = "备注信息")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,9 @@ import lombok.experimental.Accessors;
|
||||||
@Schema(name = "MenuIcon对象", title = "系统菜单图标", description = "系统菜单图标")
|
@Schema(name = "MenuIcon对象", title = "系统菜单图标", description = "系统菜单图标")
|
||||||
public class MenuIcon extends BaseEntity {
|
public class MenuIcon extends BaseEntity {
|
||||||
|
|
||||||
|
@Schema(name = "iconCode", title = "icon类名")
|
||||||
|
private String iconCode;
|
||||||
|
|
||||||
@Schema(name = "iconName", title = "icon 名称")
|
@Schema(name = "iconName", title = "icon 名称")
|
||||||
private String iconName;
|
private String iconName;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,4 @@ public class DeptVo extends BaseVo {
|
||||||
@Schema(name = "summary", title = "部门简介")
|
@Schema(name = "summary", title = "部门简介")
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
@Schema(name = "remarks", title = "备注信息")
|
|
||||||
private String remarks;
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,6 +12,9 @@ import lombok.*;
|
||||||
@Schema(name = "MenuIconVo对象", title = "系统菜单图标", description = "系统菜单图标")
|
@Schema(name = "MenuIconVo对象", title = "系统菜单图标", description = "系统菜单图标")
|
||||||
public class MenuIconVo extends BaseVo {
|
public class MenuIconVo extends BaseVo {
|
||||||
|
|
||||||
|
@Schema(name = "iconCode", title = "icon类名")
|
||||||
|
private String iconCode;
|
||||||
|
|
||||||
@Schema(name = "iconName", title = "icon 名称")
|
@Schema(name = "iconName", title = "icon 名称")
|
||||||
private String iconName;
|
private String iconName;
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,13 @@ public class UserController {
|
||||||
return Result.success(vo);
|
return Result.success(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "强制退出", description = "强制退出")
|
||||||
|
@PutMapping("forcedOffline")
|
||||||
|
public Result<String> forcedOffline(@RequestBody Long id) {
|
||||||
|
userService.forcedOffline(id);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "退出登录", description = "退出登录")
|
@Operation(summary = "退出登录", description = "退出登录")
|
||||||
@PostMapping("logout")
|
@PostMapping("logout")
|
||||||
public Result<String> logout() {
|
public Result<String> logout() {
|
||||||
|
|
|
@ -93,4 +93,11 @@ public interface UserService extends IService<AdminUser> {
|
||||||
* @param dto 管理员用户修改头像
|
* @param dto 管理员用户修改头像
|
||||||
*/
|
*/
|
||||||
void uploadAvatarByAdmin(UserUpdateWithAvatarDto dto);
|
void uploadAvatarByAdmin(UserUpdateWithAvatarDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 强制退出
|
||||||
|
*
|
||||||
|
* @param id 用户id
|
||||||
|
*/
|
||||||
|
void forcedOffline(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,6 +200,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
||||||
updateById(adminUser);
|
updateById(adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 强制退出
|
||||||
|
*
|
||||||
|
* @param id 用户id
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void forcedOffline(Long id) {
|
||||||
|
if (id == null) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||||
|
|
||||||
|
// 根据id查询用户登录前缀
|
||||||
|
AdminUser adminUser = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, id));
|
||||||
|
String email = adminUser.getEmail();
|
||||||
|
String adminLoginInfoPrefix = RedisUserConstant.getAdminLoginInfoPrefix(email);
|
||||||
|
|
||||||
|
redisTemplate.delete(adminLoginInfoPrefix);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* * 用户信息 服务实现类
|
* * 用户信息 服务实现类
|
||||||
*
|
*
|
||||||
|
|
|
@ -14,17 +14,17 @@
|
||||||
<id column="manager_id" property="managerId"/>
|
<id column="manager_id" property="managerId"/>
|
||||||
<id column="dept_name" property="deptName"/>
|
<id column="dept_name" property="deptName"/>
|
||||||
<id column="summary" property="summary"/>
|
<id column="summary" property="summary"/>
|
||||||
<id column="remarks" property="remarks"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, create_time, update_time, create_user, update_user, is_deleted, parent_id, manager_id, dept_name, summary, remarks
|
id, create_time, update_time, create_user, update_user, is_deleted, parent_id, manager_id, dept_name, summary
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询部门内容 -->
|
<!-- 分页查询部门内容 -->
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.Dept">
|
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.Dept">
|
||||||
select <include refid="Base_Column_List"/>
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
from sys_dept
|
from sys_dept
|
||||||
<where>
|
<where>
|
||||||
<if test="dto.parentId != null and dto.parentId != ''">
|
<if test="dto.parentId != null and dto.parentId != ''">
|
||||||
|
@ -39,9 +39,6 @@
|
||||||
<if test="dto.summary != null and dto.summary != ''">
|
<if test="dto.summary != null and dto.summary != ''">
|
||||||
summary like CONCAT('%',#{dto.summary},'%')
|
summary like CONCAT('%',#{dto.summary},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.remarks != null and dto.remarks != ''">
|
|
||||||
remarks like CONCAT('%',#{dto.remarks},'%')
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
order by update_time
|
order by update_time
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -11,18 +11,23 @@
|
||||||
<id column="update_user" property="updateUser"/>
|
<id column="update_user" property="updateUser"/>
|
||||||
<id column="is_deleted" property="isDeleted"/>
|
<id column="is_deleted" property="isDeleted"/>
|
||||||
<id column="icon_name" property="iconName"/>
|
<id column="icon_name" property="iconName"/>
|
||||||
|
<id column="icon_code" property="iconCode"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, create_time, update_time, create_user, update_user, is_deleted, icon_name
|
id, create_time, update_time, create_user, update_user, is_deleted, icon_name, icon_code
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询系统菜单图标内容 -->
|
<!-- 分页查询系统菜单图标内容 -->
|
||||||
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.MenuIcon">
|
<select id="selectListByPage" resultType="cn.bunny.dao.entity.system.MenuIcon">
|
||||||
select <include refid="Base_Column_List"/>
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
from sys_menu_icon
|
from sys_menu_icon
|
||||||
<where>
|
<where>
|
||||||
|
<if test="dto.iconCode != null and dto.iconCode != ''">
|
||||||
|
icon_code like CONCAT('%',#{dto.iconCode},'%')
|
||||||
|
</if>
|
||||||
<if test="dto.iconName != null and dto.iconName != ''">
|
<if test="dto.iconName != null and dto.iconName != ''">
|
||||||
icon_name like CONCAT('%',#{dto.iconName},'%')
|
icon_name like CONCAT('%',#{dto.iconName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
Loading…
Reference in New Issue