BUGFIX: library upload md5重复校验优化;
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user