-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro
# Conflicts: # yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImplTest.java
- Loading branch information
Showing
17 changed files
with
234 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ule-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/LogRecordConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cn.iocoder.yudao.module.system.enums; | ||
|
||
/** | ||
* System 操作日志枚举 | ||
* 目的:统一管理,也减少 Service 里各种“复杂”字符串 | ||
* | ||
* @author 芋道源码 | ||
*/ | ||
public interface LogRecordConstants { | ||
|
||
// ======================= SYSTEM_USER 用户 ======================= | ||
|
||
String SYSTEM_USER_TYPE = "SYSTEM 用户"; | ||
String SYSTEM_USER_CREATE_SUB_TYPE = "创建用户"; | ||
String SYSTEM_USER_CREATE_SUCCESS = "创建了用户【{{#user.nickname}}】"; | ||
String SYSTEM_USER_UPDATE_SUB_TYPE = "更新用户"; | ||
String SYSTEM_USER_UPDATE_SUCCESS = "更新了用户【{{#user.nickname}}】: {_DIFF{#updateReqVO}}"; | ||
String SYSTEM_USER_DELETE_SUB_TYPE = "删除用户"; | ||
String SYSTEM_USER_DELETE_SUCCESS = "删除了用户【{{#user.nickname}}】"; | ||
String SYSTEM_USER_UPDATE_PASSWORD_SUB_TYPE = "重置用户密码"; | ||
String SYSTEM_USER_UPDATE_PASSWORD_SUCCESS = "将用户【{{#user.nickname}}】的密码从【{{#user.password}}】重置为【{{#newPassword}}】"; | ||
|
||
// ======================= SYSTEM_ROLE 角色 ======================= | ||
|
||
String SYSTEM_ROLE_TYPE = "SYSTEM 角色"; | ||
String SYSTEM_ROLE_CREATE_SUB_TYPE = "创建角色"; | ||
String SYSTEM_ROLE_CREATE_SUCCESS = "创建了角色【{{#role.name}}】"; | ||
String SYSTEM_ROLE_UPDATE_SUB_TYPE = "更新角色"; | ||
String SYSTEM_ROLE_UPDATE_SUCCESS = "更新了角色【{{#role.name}}】: {_DIFF{#updateReqVO}}"; | ||
String SYSTEM_ROLE_DELETE_SUB_TYPE = "删除角色"; | ||
String SYSTEM_ROLE_DELETE_SUCCESS = "删除了角色【{{#role.name}}】"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
...ocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,11 @@ | |
|
||
import cn.hutool.core.util.ObjectUtil; | ||
import cn.iocoder.yudao.framework.common.validation.Mobile; | ||
import cn.iocoder.yudao.module.system.framework.operatelog.core.DeptParseFunction; | ||
import cn.iocoder.yudao.module.system.framework.operatelog.core.PostParseFunction; | ||
import cn.iocoder.yudao.module.system.framework.operatelog.core.SexParseFunction; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.mzt.logapi.starter.annotation.DiffLogField; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Data; | ||
import org.hibernate.validator.constraints.Length; | ||
|
@@ -21,34 +25,43 @@ public class UserSaveReqVO { | |
@NotBlank(message = "用户账号不能为空") | ||
@Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成") | ||
@Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符") | ||
@DiffLogField(name = "用户账号") | ||
private String username; | ||
|
||
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | ||
@Size(max = 30, message = "用户昵称长度不能超过30个字符") | ||
@DiffLogField(name = "用户昵称") | ||
private String nickname; | ||
|
||
@Schema(description = "备注", example = "我是一个用户") | ||
@DiffLogField(name = "备注") | ||
private String remark; | ||
|
||
@Schema(description = "部门ID", example = "我是一个用户") | ||
@Schema(description = "部门编号", example = "我是一个用户") | ||
@DiffLogField(name = "部门", function = DeptParseFunction.NAME) | ||
private Long deptId; | ||
|
||
@Schema(description = "岗位编号数组", example = "1") | ||
@DiffLogField(name = "岗位", function = PostParseFunction.NAME) | ||
private Set<Long> postIds; | ||
|
||
@Schema(description = "用户邮箱", example = "[email protected]") | ||
@Email(message = "邮箱格式不正确") | ||
@Size(max = 50, message = "邮箱长度不能超过 50 个字符") | ||
@DiffLogField(name = "用户邮箱") | ||
private String email; | ||
|
||
@Schema(description = "手机号码", example = "15601691300") | ||
@Mobile | ||
@DiffLogField(name = "手机号码") | ||
private String mobile; | ||
|
||
@Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1") | ||
@DiffLogField(name = "用户性别", function = SexParseFunction.NAME) | ||
private Integer sex; | ||
|
||
@Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png") | ||
@DiffLogField(name = "用户头像") | ||
private String avatar; | ||
|
||
// ========== 仅【创建】时,需要传递的字段 ========== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...main/java/cn/iocoder/yudao/module/system/framework/operatelog/core/PostParseFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package cn.iocoder.yudao.module.system.framework.operatelog.core; | ||
|
||
import cn.hutool.core.convert.Convert; | ||
import cn.hutool.core.util.StrUtil; | ||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | ||
import cn.iocoder.yudao.module.system.service.dept.PostService; | ||
import com.mzt.logapi.service.IParseFunction; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.Resource; | ||
|
||
/** | ||
* 岗位名字的 {@link IParseFunction} 实现类 | ||
* | ||
* @author HUIHUI | ||
*/ | ||
@Slf4j | ||
@Component | ||
public class PostParseFunction implements IParseFunction { | ||
|
||
public static final String NAME = "getPostById"; | ||
|
||
@Resource | ||
private PostService postService; | ||
|
||
@Override | ||
public String functionName() { | ||
return NAME; | ||
} | ||
|
||
@Override | ||
public String apply(Object value) { | ||
if (StrUtil.isEmptyIfStr(value)) { | ||
return ""; | ||
} | ||
|
||
// 获取岗位信息 | ||
PostDO post = postService.getPost(Convert.toLong(value)); | ||
if (post == null) { | ||
log.warn("[apply][获取岗位{{}}为空", value); | ||
return ""; | ||
} | ||
return post.getName(); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...m-biz/src/main/java/cn/iocoder/yudao/module/system/framework/operatelog/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
/** | ||
* 占位文件,避免文件夹缩进 | ||
*/ | ||
package cn.iocoder.yudao.module.system.framework.operatelog; |
Oops, something went wrong.