优化审计记录。
This commit is contained in:
parent
f22aad8b27
commit
75913cdc1b
|
|
@ -31,6 +31,8 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
|
|||
private EdTagLibraryMapper edTagLibraryMapper;
|
||||
@Resource
|
||||
private EdFileInfoMapper edFileInfoMapper;
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
private boolean addTagToFile(String fileId, String tagId, String createdBy) {
|
||||
// 检查标签是否存在并且已发布
|
||||
|
|
@ -68,8 +70,15 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
|
|||
isSuccess &= addTagToFile(fileId, tagId, createdBy);
|
||||
}
|
||||
if (isSuccess) {
|
||||
|
||||
String tags = edTagLibraryMapper.selectList(new LambdaQueryWrapper<EdTagLibrary>()
|
||||
.in(EdTagLibrary::getTagId, tagIds)
|
||||
.select(EdTagLibrary::getTagName)
|
||||
.eq(EdTagLibrary::getIsPublished, PublishEnum.PUBLISHED.getCode())).stream().map(EdTagLibrary::getTagName).collect(Collectors.joining(","));
|
||||
|
||||
EdFileInfo fileInfo = edFileInfoMapper.selectById(fileId);
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签到文件");
|
||||
String dbPath = commonService.getDbPath(fileInfo.getFilePath());
|
||||
UserThreadLocal.setSuccessInfo(Optional.ofNullable(fileInfo).map(EdFileInfo::getParentId).orElse(""), fileId, "添加了标签 {} 到文件 {}", tags, dbPath);
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue