rename packages and classes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3443dcaa95
commit
4c79d502e3
@ -7,7 +7,7 @@ import org.hibernate.Transaction;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import wtf.beatrice.releasehive.db.HibernateManager;
|
import wtf.beatrice.releasehive.db.HibernateManager;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import org.springframework.security.config.annotation.authentication.configurati
|
|||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import wtf.beatrice.releasehive.repository.UserRepository;
|
import wtf.beatrice.releasehive.repositories.UserRepository;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ApplicationConfiguration
|
public class ApplicationConfiguration
|
||||||
|
@ -13,9 +13,9 @@ import org.springframework.security.web.authentication.WebAuthenticationDetailsS
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.filter.OncePerRequestFilter;
|
import org.springframework.web.filter.OncePerRequestFilter;
|
||||||
import org.springframework.web.servlet.HandlerExceptionResolver;
|
import org.springframework.web.servlet.HandlerExceptionResolver;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
import wtf.beatrice.releasehive.service.JWTService;
|
import wtf.beatrice.releasehive.services.JWTService;
|
||||||
import wtf.beatrice.releasehive.service.UserDetailsExtendedService;
|
import wtf.beatrice.releasehive.services.UserDetailsExtendedService;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.dto;
|
package wtf.beatrice.releasehive.dtos;
|
||||||
|
|
||||||
public class LoginUserDto
|
public class LoginUserDto
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.dto;
|
package wtf.beatrice.releasehive.dtos;
|
||||||
|
|
||||||
public class RegisterUserDto
|
public class RegisterUserDto
|
||||||
{
|
{
|
@ -14,9 +14,9 @@ import java.nio.file.AccessDeniedException;
|
|||||||
import java.security.SignatureException;
|
import java.security.SignatureException;
|
||||||
|
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class GlobalExceptionHandler
|
public class RestExceptionHandler
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = LogManager.getLogger(GlobalExceptionHandler.class);
|
private static final Logger LOGGER = LogManager.getLogger(RestExceptionHandler.class);
|
||||||
private static final String DESCRIPTION_PROPERTY = "description";
|
private static final String DESCRIPTION_PROPERTY = "description";
|
||||||
|
|
||||||
@ExceptionHandler(Exception.class)
|
@ExceptionHandler(Exception.class)
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.model;
|
package wtf.beatrice.releasehive.models;
|
||||||
|
|
||||||
public class LoginResponse
|
public class LoginResponse
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.model;
|
package wtf.beatrice.releasehive.models;
|
||||||
|
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
@ -1,8 +1,8 @@
|
|||||||
package wtf.beatrice.releasehive.repository;
|
package wtf.beatrice.releasehive.repositories;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.resource;
|
package wtf.beatrice.releasehive.resources;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@ -6,12 +6,12 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import wtf.beatrice.releasehive.dto.LoginUserDto;
|
import wtf.beatrice.releasehive.dtos.LoginUserDto;
|
||||||
import wtf.beatrice.releasehive.dto.RegisterUserDto;
|
import wtf.beatrice.releasehive.dtos.RegisterUserDto;
|
||||||
import wtf.beatrice.releasehive.model.LoginResponse;
|
import wtf.beatrice.releasehive.models.LoginResponse;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
import wtf.beatrice.releasehive.service.AccountService;
|
import wtf.beatrice.releasehive.services.AccountService;
|
||||||
import wtf.beatrice.releasehive.service.JWTService;
|
import wtf.beatrice.releasehive.services.JWTService;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1/auth")
|
@RequestMapping("/api/v1/auth")
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.resource;
|
package wtf.beatrice.releasehive.resources;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -8,8 +8,8 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
import wtf.beatrice.releasehive.service.UserService;
|
import wtf.beatrice.releasehive.services.UserService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
package wtf.beatrice.releasehive.service;
|
|
||||||
|
|
||||||
import wtf.beatrice.releasehive.dto.LoginUserDto;
|
|
||||||
import wtf.beatrice.releasehive.dto.RegisterUserDto;
|
|
||||||
import wtf.beatrice.releasehive.model.User;
|
|
||||||
|
|
||||||
public interface AccountService
|
|
||||||
{
|
|
||||||
|
|
||||||
User register(RegisterUserDto user);
|
|
||||||
|
|
||||||
User login(LoginUserDto user);
|
|
||||||
}
|
|
@ -0,0 +1,13 @@
|
|||||||
|
package wtf.beatrice.releasehive.services;
|
||||||
|
|
||||||
|
import wtf.beatrice.releasehive.dtos.LoginUserDto;
|
||||||
|
import wtf.beatrice.releasehive.dtos.RegisterUserDto;
|
||||||
|
import wtf.beatrice.releasehive.models.User;
|
||||||
|
|
||||||
|
public interface AccountService
|
||||||
|
{
|
||||||
|
|
||||||
|
User register(RegisterUserDto user);
|
||||||
|
|
||||||
|
User login(LoginUserDto user);
|
||||||
|
}
|
@ -1,14 +1,14 @@
|
|||||||
package wtf.beatrice.releasehive.service;
|
package wtf.beatrice.releasehive.services;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import wtf.beatrice.releasehive.dto.LoginUserDto;
|
import wtf.beatrice.releasehive.dtos.LoginUserDto;
|
||||||
import wtf.beatrice.releasehive.dto.RegisterUserDto;
|
import wtf.beatrice.releasehive.dtos.RegisterUserDto;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
import wtf.beatrice.releasehive.repository.UserRepository;
|
import wtf.beatrice.releasehive.repositories.UserRepository;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AccountServiceImpl implements AccountService {
|
public class AccountServiceImpl implements AccountService {
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.service;
|
package wtf.beatrice.releasehive.services;
|
||||||
|
|
||||||
import io.jsonwebtoken.Claims;
|
import io.jsonwebtoken.Claims;
|
||||||
import io.jsonwebtoken.Jwts;
|
import io.jsonwebtoken.Jwts;
|
||||||
@ -7,7 +7,7 @@ import io.jsonwebtoken.io.Decoders;
|
|||||||
import io.jsonwebtoken.security.Keys;
|
import io.jsonwebtoken.security.Keys;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
|
|
||||||
import java.security.Key;
|
import java.security.Key;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
@ -1,10 +1,10 @@
|
|||||||
package wtf.beatrice.releasehive.service;
|
package wtf.beatrice.releasehive.services;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
import wtf.beatrice.releasehive.repository.UserRepository;
|
import wtf.beatrice.releasehive.repositories.UserRepository;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class UserDetailsExtendedService {
|
public class UserDetailsExtendedService {
|
@ -1,9 +1,9 @@
|
|||||||
package wtf.beatrice.releasehive.service;
|
package wtf.beatrice.releasehive.services;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import wtf.beatrice.releasehive.model.User;
|
import wtf.beatrice.releasehive.models.User;
|
||||||
import wtf.beatrice.releasehive.repository.UserRepository;
|
import wtf.beatrice.releasehive.repositories.UserRepository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package wtf.beatrice.releasehive.util;
|
package wtf.beatrice.releasehive.utils;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
@ -22,7 +22,7 @@
|
|||||||
<property name="hibernate.hbm2ddl.auto">update</property>
|
<property name="hibernate.hbm2ddl.auto">update</property>
|
||||||
|
|
||||||
<!-- Annotated entity classes -->
|
<!-- Annotated entity classes -->
|
||||||
<mapping class="wtf.beatrice.releasehive.model.User"/>
|
<mapping class="wtf.beatrice.releasehive.models.User"/>
|
||||||
|
|
||||||
</session-factory>
|
</session-factory>
|
||||||
</hibernate-configuration>
|
</hibernate-configuration>
|
||||||
|
Loading…
Reference in New Issue
Block a user