feat(iam): 添加日志

This commit is contained in:
yjz
2023-11-09 19:27:00 +08:00
parent 10e39e1661
commit 15f844e396
3 changed files with 23 additions and 6 deletions
@@ -468,13 +468,19 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
//step.1 保存用户
// 对手机号、邮箱进行加密处理
this.proceedUserInfoEncrypt(user);
long a = System.currentTimeMillis();
this.save(user);
long b = System.currentTimeMillis();
log.info("保存用户耗时:" + (b - a));
//step.2 保存角色
if(oConvertUtils.isNotEmpty(selectedRoles)) {
String[] arr = selectedRoles.split(",");
for (String roleId : arr) {
SysUserRole userRole = new SysUserRole(user.getId(), roleId);
long c = System.currentTimeMillis();
sysUserRoleMapper.insert(userRole);
long d = System.currentTimeMillis();
log.info("保存角色耗时:" + (c - d));
}
}
//step.3 保存所属部门
@@ -482,7 +488,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
String[] arr = selectedDeparts.split(",");
for (String deaprtId : arr) {
SysUserDepart userDeaprt = new SysUserDepart(user.getId(), deaprtId);
long e = System.currentTimeMillis();
sysUserDepartMapper.insert(userDeaprt);
long f = System.currentTimeMillis();
log.info("保存部门耗时:" + (e - f));
}
}
}