View Javadoc
1   package fr.tiogars.inception.domains.auth.user.services;
2   
3   import java.util.List;
4   
5   import org.springframework.stereotype.Service;
6   import org.springframework.transaction.annotation.Transactional;
7   
8   import fr.tiogars.inception.common.models.DeleteSelectedResponse;
9   import fr.tiogars.inception.common.services.DeleteSelectedSupport;
10  
11  /** Deletes a selection of users in a single transaction. */
12  @Service
13  public class UserDeleteSelectedService {
14  
15      private final UserService userService;
16  
17      public UserDeleteSelectedService(UserService userService) {
18          this.userService = userService;
19      }
20  
21      @Transactional
22      public DeleteSelectedResponse deleteSelected(List<Long> ids) {
23          return DeleteSelectedSupport.deleteEach(ids, userService::delete);
24      }
25  }