BUGFIX: library upload md5重复校验优化;

This commit is contained in:
shahaibo
2023-10-18 15:54:23 +08:00
parent 4c11f2e280
commit 81d20625f5
4 changed files with 14 additions and 4 deletions

View File

@@ -72,5 +72,5 @@ public interface LibraryService extends IService<Library> {
String processMannequins(String uploadPath);
void checkMd5(String level1Type, String level2Type, String sex, String md5);
Boolean checkMd5(String level1Type, String level2Type, String sex, String md5);
}

View File

@@ -258,7 +258,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
}
@Override
public void checkMd5(String level1Type, String level2Type, String sex, String md5) {
public Boolean checkMd5(String level1Type, String level2Type, String sex, String md5) {
AuthPrincipalVo userInfo = UserContext.getUserHolder();
QueryWrapper<Library> qw = new QueryWrapper<>();
qw.lambda().eq(Library::getAccountId, userInfo.getId());
@@ -274,7 +274,10 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
qw.lambda().eq(Library::getMd5, md5);
List<Library> libraryList = libraryMapper.selectList(qw);
if (!CollectionUtils.isEmpty(libraryList)) {
throw new BusinessException("Your library already contains the images you uploaded, Are you sure to upload them");
// throw new BusinessException("Your library already contains the images you uploaded, Are you sure to upload them");
return Boolean.FALSE;
}else {
return Boolean.TRUE;
}
}