Skip to content

Commit

Permalink
Migrate to Spring Boot 3
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGuancheDarias committed Feb 9, 2024
1 parent dbc2fc1 commit bbee9c8
Show file tree
Hide file tree
Showing 137 changed files with 1,070 additions and 929 deletions.
54 changes: 52 additions & 2 deletions business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.14</version>
<version>3.0.13</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.kevinguanchedarias.owge</groupId>
Expand Down Expand Up @@ -95,6 +95,22 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -176,13 +192,33 @@
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate.jakarta.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.github.KevinGuancheDarias</groupId>
<artifactId>kevinsuite-java-rest-commons</artifactId>
<version>v0.4.2</version>
<version>v0.5.0</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
Expand All @@ -195,13 +231,27 @@
<groupId>com.github.KevinGuancheDarias</groupId>
<artifactId>taggable-cache</artifactId>
<version>v0.2.2</version>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import java.io.Serial;
import java.util.Date;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import com.kevinguanchedarias.owgejava.pojo.TokenPojo;
import com.kevinguanchedarias.owgejava.repository.AdminUserRepository;
import io.jsonwebtoken.SignatureAlgorithm;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.io.Serial;
import java.util.Date;
import java.util.HashMap;
Expand All @@ -29,7 +29,7 @@
public class AdminUserBo implements BaseBo<Integer, AdminUser, AdminUserDto> {
@Serial
private static final long serialVersionUID = -5545554818842439920L;

public static final String ADMIN_USER_CACHE_TAG = "admin_user";
public static final String JWT_SECRET_DB_CODE = "ADMIN_JWT_SECRET";
public static final String JWT_HASHING_ALGO = "ADMIN_JWT_ALGO";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.io.Serializable;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -17,37 +17,37 @@
/**
* Has methods to interact with the authentication system
*
* @since 0.8.0
* @author Kevin Guanche Darias <[email protected]>
* @since 0.8.0
*/
@Service
public class AuthenticationBo implements Serializable {
private static final long serialVersionUID = 5427846503367637891L;

private static final Logger LOGGER = Logger.getLogger(AuthenticationBo.class);

@Autowired(required = false)
private transient SecurityContextService securityContextService;

@PostConstruct
public void init() {
if (securityContextService == null) {
securityContextService = new SecurityContextService();
LOGGER.warn("Had to spawn an entire " + SecurityContextService.class.getName()
+ " because it's not defined as a bean, define a singletone bean for performance and convenience purposes");
}
}

/**
* Finds the currently logged in user token
*
* @return
* @since 0.8.0
* @author Kevin Guanche Darias <[email protected]>
*/
public TokenUser findTokenUser() {
return securityContextService != null && securityContextService.getAuthentication() != null
? (TokenUser) securityContextService.getAuthentication().getDetails()
: null;
}
private static final long serialVersionUID = 5427846503367637891L;

private static final Logger LOGGER = Logger.getLogger(AuthenticationBo.class);

@Autowired(required = false)
private transient SecurityContextService securityContextService;

@PostConstruct
public void init() {
if (securityContextService == null) {
securityContextService = new SecurityContextService();
LOGGER.warn("Had to spawn an entire " + SecurityContextService.class.getName()
+ " because it's not defined as a bean, define a singletone bean for performance and convenience purposes");
}
}

/**
* Finds the currently logged in user token
*
* @return
* @author Kevin Guanche Darias <[email protected]>
* @since 0.8.0
*/
public TokenUser findTokenUser() {
return securityContextService != null && securityContextService.getAuthentication() != null
? (TokenUser) securityContextService.getAuthentication().getDetails()
: null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import com.kevinguanchedarias.owgejava.entity.SpecialLocation;
import com.kevinguanchedarias.owgejava.exception.ProgrammingException;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;

import java.io.Serializable;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import java.io.Serial;
import java.io.Serializable;
import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;

import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import java.io.Serial;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;

import java.io.Serial;
import java.util.List;

Expand Down
Loading

0 comments on commit bbee9c8

Please sign in to comment.