!114 更新角色时,记录修改内容

Merge pull request !114 from syubun/master
This commit is contained in:
芋道源码 2024-05-11 15:53:22 +00:00 committed by Gitee
commit 1889822deb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum;
import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.mzt.logapi.context.LogRecordContext; import com.mzt.logapi.context.LogRecordContext;
import com.mzt.logapi.service.impl.DiffParseFunction;
import com.mzt.logapi.starter.annotation.LogRecord; import com.mzt.logapi.starter.annotation.LogRecord;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
@ -116,6 +117,7 @@ public class RoleServiceImpl implements RoleService {
permissionService.processRoleDeleted(id); permissionService.processRoleDeleted(id);
// 3. 记录操作日志上下文 // 3. 记录操作日志上下文
LogRecordContext.putVariable(DiffParseFunction.OLD_OBJECT, BeanUtils.toBean(role, RoleSaveReqVO.class));
LogRecordContext.putVariable("role", role); LogRecordContext.putVariable("role", role);
} }