87 fixed imports
This commit is contained in:
parent
d88f67ce00
commit
48a18a3a57
@ -11,26 +11,18 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import ru.ulstu.configuration.Constants;
|
import ru.ulstu.configuration.Constants;
|
||||||
import ru.ulstu.odin.controller.OdinController;
|
import ru.ulstu.odin.controller.OdinController;
|
||||||
import ru.ulstu.user.error.UserSendingMailException;
|
import ru.ulstu.user.error.UserSendingMailException;
|
||||||
import ru.ulstu.user.model.*;
|
import ru.ulstu.user.model.UserDto;
|
||||||
|
import ru.ulstu.user.model.User;
|
||||||
|
import ru.ulstu.user.model.UserListDto;
|
||||||
import ru.ulstu.user.service.UserService;
|
import ru.ulstu.user.service.UserService;
|
||||||
import ru.ulstu.user.service.UserSessionService;
|
import ru.ulstu.user.service.UserSessionService;
|
||||||
|
|
||||||
import javax.mail.MessagingException;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "/users")
|
@RequestMapping(value = "/users")
|
||||||
public class UserControllerV2 extends OdinController<UserListDto, UserDto> {
|
public class UserControllerV2 extends OdinController<UserListDto, UserDto> {
|
||||||
public static final String URL = Constants.API_1_0 + "users";
|
|
||||||
public static final String ROLES_URL = "/roles";
|
|
||||||
public static final String ROLES_META_URL = ROLES_URL + OdinController.META_LIST_URL;
|
|
||||||
public static final String SESSIONS_URL = "/sessions";
|
|
||||||
public static final String SESSIONS_META_URL = SESSIONS_URL + OdinController.META_LIST_URL;
|
|
||||||
public static final String REGISTER_URL = "/register";
|
|
||||||
public static final String ACTIVATE_URL = "/activate";
|
|
||||||
public static final String PASSWORD_RESET_REQUEST_URL = "/password-reset-request";
|
|
||||||
public static final String PASSWORD_RESET_URL = "/password-reset";
|
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(UserController.class);
|
private final Logger log = LoggerFactory.getLogger(UserController.class);
|
||||||
|
|
||||||
|
@ -13,12 +13,20 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import ru.ulstu.configuration.ApplicationProperties;
|
import ru.ulstu.configuration.ApplicationProperties;
|
||||||
import ru.ulstu.configuration.Constants;
|
|
||||||
import ru.ulstu.core.error.EntityIdIsNullException;
|
import ru.ulstu.core.error.EntityIdIsNullException;
|
||||||
import ru.ulstu.core.jpa.OffsetablePageRequest;
|
import ru.ulstu.core.jpa.OffsetablePageRequest;
|
||||||
import ru.ulstu.core.model.BaseEntity;
|
import ru.ulstu.core.model.BaseEntity;
|
||||||
import ru.ulstu.core.model.response.PageableItems;
|
import ru.ulstu.core.model.response.PageableItems;
|
||||||
import ru.ulstu.user.error.*;
|
import ru.ulstu.user.error.UserActivationError;
|
||||||
|
import ru.ulstu.user.error.UserEmailExistsException;
|
||||||
|
import ru.ulstu.user.error.UserIdExistsException;
|
||||||
|
import ru.ulstu.user.error.UserIsUndeadException;
|
||||||
|
import ru.ulstu.user.error.UserLoginExistsException;
|
||||||
|
import ru.ulstu.user.error.UserNotActivatedException;
|
||||||
|
import ru.ulstu.user.error.UserNotFoundException;
|
||||||
|
import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException;
|
||||||
|
import ru.ulstu.user.error.UserResetKeyError;
|
||||||
|
import ru.ulstu.user.error.UserSendingMailException;
|
||||||
import ru.ulstu.user.model.User;
|
import ru.ulstu.user.model.User;
|
||||||
import ru.ulstu.user.model.UserDto;
|
import ru.ulstu.user.model.UserDto;
|
||||||
import ru.ulstu.user.model.UserListDto;
|
import ru.ulstu.user.model.UserListDto;
|
||||||
@ -31,7 +39,14 @@ import ru.ulstu.user.repository.UserRoleRepository;
|
|||||||
import ru.ulstu.user.util.UserUtils;
|
import ru.ulstu.user.util.UserUtils;
|
||||||
|
|
||||||
import javax.mail.MessagingException;
|
import javax.mail.MessagingException;
|
||||||
import java.util.*;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -44,7 +59,6 @@ public class UserService implements UserDetailsService {
|
|||||||
private final UserMapper userMapper;
|
private final UserMapper userMapper;
|
||||||
private final MailService mailService;
|
private final MailService mailService;
|
||||||
private final ApplicationProperties applicationProperties;
|
private final ApplicationProperties applicationProperties;
|
||||||
private final Random random;
|
|
||||||
|
|
||||||
public UserService(UserRepository userRepository,
|
public UserService(UserRepository userRepository,
|
||||||
PasswordEncoder passwordEncoder,
|
PasswordEncoder passwordEncoder,
|
||||||
@ -58,7 +72,6 @@ public class UserService implements UserDetailsService {
|
|||||||
this.userMapper = userMapper;
|
this.userMapper = userMapper;
|
||||||
this.mailService = mailService;
|
this.mailService = mailService;
|
||||||
this.applicationProperties = applicationProperties;
|
this.applicationProperties = applicationProperties;
|
||||||
this.random = new Random();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private User getUserByEmail(String email) {
|
private User getUserByEmail(String email) {
|
||||||
|
Loading…
Reference in New Issue
Block a user