xiongzhu %!s(int64=4) %!d(string=hai) anos
pai
achega
a81e7d1a0a

+ 4 - 1
src/main/java/com/izouma/nineth/service/IdentityAuthService.java

@@ -63,6 +63,8 @@ public class IdentityAuthService {
         identityAuthRepo.save(identityAuth);
         user.setAuthStatus(AuthStatus.PENDING);
         userRepo.save(user);
+
+        identityAuthRepo.deleteDuplicated(identityAuth.getUserId(), identityAuth.getId());
     }
 
     public void audit(Long id, AuthStatus status, String reason) {
@@ -83,6 +85,7 @@ public class IdentityAuthService {
         auth.setAutoValidated(true);
         identityAuthRepo.save(auth);
 
+        identityAuthRepo.deleteDuplicated(auth.getUserId(), auth.getId());
     }
 
     public List<User> repeat(String idNo, Long userId) {
@@ -141,7 +144,7 @@ public class IdentityAuthService {
 
     public void removeDuplicated() {
         boolean hasMore = true;
-        int pageNum = 1;
+        int pageNum = 0;
         AtomicInteger count = new AtomicInteger();
         while (hasMore) {
             Page<Long> page = identityAuthRepo.listUserId(PageRequest.of(pageNum, 100));