fix: 重复 file 路径 Bug

This commit is contained in:
gaibu 2022-12-30 16:07:53 +08:00
parent 9a46860086
commit 639c7820f9

View File

@ -30,7 +30,7 @@ public class FileContentDAOImpl implements DBFileContentFrameworkDAO {
@Override @Override
public byte[] selectContent(Long configId, String path) { public byte[] selectContent(Long configId, String path) {
List<FileContentDO> fileContentDOs = fileContentMapper.selectList( List<FileContentDO> fileContentDOs = fileContentMapper.selectList(
buildQuery(configId, path).select(FileContentDO::getContent)); buildQuery(configId, path).select(FileContentDO::getContent).orderByDesc(FileContentDO::getId));
return CollUtil.isNotEmpty(fileContentDOs) ? CollUtil.getFirst(fileContentDOs).getContent() : null; return CollUtil.isNotEmpty(fileContentDOs) ? CollUtil.getFirst(fileContentDOs).getContent() : null;
} }