rename packages and classes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2024-08-07 22:57:28 +02:00
parent 3443dcaa95
commit 4c79d502e3
19 changed files with 51 additions and 51 deletions

View File

@ -7,7 +7,7 @@ import org.hibernate.Transaction;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import wtf.beatrice.releasehive.db.HibernateManager;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.models.User;
import java.util.List;

View File

@ -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.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import wtf.beatrice.releasehive.repository.UserRepository;
import wtf.beatrice.releasehive.repositories.UserRepository;
@Configuration
public class ApplicationConfiguration

View File

@ -13,9 +13,9 @@ import org.springframework.security.web.authentication.WebAuthenticationDetailsS
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.web.servlet.HandlerExceptionResolver;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.service.JWTService;
import wtf.beatrice.releasehive.service.UserDetailsExtendedService;
import wtf.beatrice.releasehive.models.User;
import wtf.beatrice.releasehive.services.JWTService;
import wtf.beatrice.releasehive.services.UserDetailsExtendedService;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.dto;
package wtf.beatrice.releasehive.dtos;
public class LoginUserDto
{

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.dto;
package wtf.beatrice.releasehive.dtos;
public class RegisterUserDto
{

View File

@ -14,9 +14,9 @@ import java.nio.file.AccessDeniedException;
import java.security.SignatureException;
@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";
@ExceptionHandler(Exception.class)

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.model;
package wtf.beatrice.releasehive.models;
public class LoginResponse
{

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.model;
package wtf.beatrice.releasehive.models;
import jakarta.persistence.*;

View File

@ -1,8 +1,8 @@
package wtf.beatrice.releasehive.repository;
package wtf.beatrice.releasehive.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.models.User;
import java.util.Optional;
import java.util.UUID;

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.resource;
package wtf.beatrice.releasehive.resources;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import wtf.beatrice.releasehive.dto.LoginUserDto;
import wtf.beatrice.releasehive.dto.RegisterUserDto;
import wtf.beatrice.releasehive.model.LoginResponse;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.service.AccountService;
import wtf.beatrice.releasehive.service.JWTService;
import wtf.beatrice.releasehive.dtos.LoginUserDto;
import wtf.beatrice.releasehive.dtos.RegisterUserDto;
import wtf.beatrice.releasehive.models.LoginResponse;
import wtf.beatrice.releasehive.models.User;
import wtf.beatrice.releasehive.services.AccountService;
import wtf.beatrice.releasehive.services.JWTService;
@RestController
@RequestMapping("/api/v1/auth")

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.resource;
package wtf.beatrice.releasehive.resources;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.service.UserService;
import wtf.beatrice.releasehive.models.User;
import wtf.beatrice.releasehive.services.UserService;
import java.util.List;

View File

@ -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);
}

View File

@ -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);
}

View File

@ -1,14 +1,14 @@
package wtf.beatrice.releasehive.service;
package wtf.beatrice.releasehive.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import wtf.beatrice.releasehive.dto.LoginUserDto;
import wtf.beatrice.releasehive.dto.RegisterUserDto;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.repository.UserRepository;
import wtf.beatrice.releasehive.dtos.LoginUserDto;
import wtf.beatrice.releasehive.dtos.RegisterUserDto;
import wtf.beatrice.releasehive.models.User;
import wtf.beatrice.releasehive.repositories.UserRepository;
@Service
public class AccountServiceImpl implements AccountService {

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.service;
package wtf.beatrice.releasehive.services;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
@ -7,7 +7,7 @@ import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.models.User;
import java.security.Key;
import java.util.Date;

View File

@ -1,10 +1,10 @@
package wtf.beatrice.releasehive.service;
package wtf.beatrice.releasehive.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.repository.UserRepository;
import wtf.beatrice.releasehive.models.User;
import wtf.beatrice.releasehive.repositories.UserRepository;
@Service
public class UserDetailsExtendedService {

View File

@ -1,9 +1,9 @@
package wtf.beatrice.releasehive.service;
package wtf.beatrice.releasehive.services;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wtf.beatrice.releasehive.model.User;
import wtf.beatrice.releasehive.repository.UserRepository;
import wtf.beatrice.releasehive.models.User;
import wtf.beatrice.releasehive.repositories.UserRepository;
import java.util.List;

View File

@ -1,4 +1,4 @@
package wtf.beatrice.releasehive.util;
package wtf.beatrice.releasehive.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@ -22,7 +22,7 @@
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Annotated entity classes -->
<mapping class="wtf.beatrice.releasehive.model.User"/>
<mapping class="wtf.beatrice.releasehive.models.User"/>
</session-factory>
</hibernate-configuration>