Skip to content

Commit 75e082d

Browse files
committed
feat: drop lombok and bump to spring 3.5.9
1 parent af2b37f commit 75e082d

28 files changed

+812
-209
lines changed

server/pom.xml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.5.7</version>
8+
<version>3.5.9</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111

@@ -30,7 +30,7 @@
3030

3131
<!-- Properties -->
3232
<properties>
33-
<java.version>17</java.version>
33+
<java.version>21</java.version>
3434
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3535
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3636
<skip.integration.tests>true</skip.integration.tests>
@@ -132,11 +132,6 @@
132132
<groupId>org.springframework.boot</groupId>
133133
<artifactId>spring-boot-starter-actuator</artifactId>
134134
</dependency>
135-
<dependency>
136-
<groupId>org.projectlombok</groupId>
137-
<artifactId>lombok</artifactId>
138-
<optional>true</optional>
139-
</dependency>
140135

141136
<!-- Database -->
142137
<dependency>
@@ -219,18 +214,6 @@
219214
</execution>
220215
</executions>
221216
</plugin>
222-
<plugin>
223-
<groupId>org.springframework.boot</groupId>
224-
<artifactId>spring-boot-maven-plugin</artifactId>
225-
<configuration>
226-
<excludes>
227-
<exclude>
228-
<groupId>org.projectlombok</groupId>
229-
<artifactId>lombok</artifactId>
230-
</exclude>
231-
</excludes>
232-
</configuration>
233-
</plugin>
234217
<plugin>
235218
<groupId>org.apache.maven.plugins</groupId>
236219
<artifactId>maven-failsafe-plugin</artifactId>

server/src/main/java/br/com/tasknoteapp/server/config/CorsConfig.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
package br.com.tasknoteapp.server.config;
22

33
import java.util.Arrays;
4-
import lombok.extern.slf4j.Slf4j;
4+
import java.util.logging.Logger;
55
import org.springframework.beans.factory.annotation.Value;
66
import org.springframework.context.annotation.Configuration;
77
import org.springframework.lang.NonNull;
88
import org.springframework.web.servlet.config.annotation.CorsRegistry;
99
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
1010

1111
/** This class contains configurations for CORS management. */
12-
@Slf4j
1312
@Configuration
1413
public class CorsConfig implements WebMvcConfigurer {
1514

15+
private static final Logger logger = Logger.getLogger(CorsConfig.class.getName());
16+
1617
@Value("${cors.allowed-origins}")
1718
private String[] allowedOrigins;
1819

@@ -23,8 +24,8 @@ public class CorsConfig implements WebMvcConfigurer {
2324
*/
2425
public void addCorsMappings(@NonNull CorsRegistry registry) {
2526
if (allowedOrigins != null && allowedOrigins.length > 0) {
26-
log.info("CORS policy allowed origins: {}", Arrays.asList(allowedOrigins));
27-
log.debug("CORS policy allowed origins in debug mode: {}", Arrays.asList(allowedOrigins));
27+
logger.info("CORS policy allowed origins: " + Arrays.asList(allowedOrigins));
28+
logger.fine("CORS policy allowed origins in debug mode: " + Arrays.asList(allowedOrigins));
2829

2930
registry
3031
.addMapping("/**")

server/src/main/java/br/com/tasknoteapp/server/config/SecurityConfig.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import br.com.tasknoteapp.server.filter.JwtAuthenticationFilter;
44
import br.com.tasknoteapp.server.service.UserService;
55
import jakarta.servlet.http.HttpServletResponse;
6-
import lombok.RequiredArgsConstructor;
76
import org.springframework.context.annotation.Bean;
87
import org.springframework.context.annotation.Configuration;
98
import org.springframework.http.HttpMethod;
@@ -23,13 +22,17 @@
2322
/** This class contains security configurations. */
2423
@Configuration
2524
@EnableWebSecurity
26-
@RequiredArgsConstructor
2725
public class SecurityConfig {
2826

2927
private final UserService userService;
3028

3129
private final JwtAuthenticationFilter jwtAuthenticationFilter;
3230

31+
public SecurityConfig(UserService userService, JwtAuthenticationFilter jwtAuthenticationFilter) {
32+
this.userService = userService;
33+
this.jwtAuthenticationFilter = jwtAuthenticationFilter;
34+
}
35+
3336
/**
3437
* Filters a request to add security checks and configurations.
3538
*

server/src/main/java/br/com/tasknoteapp/server/controller/AuthenticationController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import io.swagger.v3.oas.annotations.tags.Tag;
1717
import jakarta.validation.Valid;
1818
import java.util.Objects;
19-
import lombok.AllArgsConstructor;
2019
import org.springframework.http.ResponseEntity;
2120
import org.springframework.web.bind.annotation.PostMapping;
2221
import org.springframework.web.bind.annotation.PutMapping;
@@ -30,11 +29,14 @@
3029
@Tag(
3130
name = "Authentication",
3231
description = "Authentication resources to handle user authentication.")
33-
@AllArgsConstructor
3432
public class AuthenticationController {
3533

3634
private final AuthService authService;
3735

36+
public AuthenticationController(AuthService authService) {
37+
this.authService = authService;
38+
}
39+
3840
/**
3941
* Signup a new user.
4042
*

server/src/main/java/br/com/tasknoteapp/server/controller/HomeController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@
77
import io.swagger.v3.oas.annotations.responses.ApiResponse;
88
import io.swagger.v3.oas.annotations.tags.Tag;
99
import java.util.List;
10-
import lombok.AllArgsConstructor;
1110
import org.springframework.web.bind.annotation.GetMapping;
1211
import org.springframework.web.bind.annotation.RequestMapping;
1312
import org.springframework.web.bind.annotation.RestController;
1413

1514
/** This class provides resources to handle home requests by the client. */
1615
@RestController
1716
@RequestMapping("/rest/home")
18-
@AllArgsConstructor
1917
@Tag(name = "Home", description = "Home resources to handle home page.")
2018
public class HomeController {
2119

2220
private final HomeService homeService;
2321

22+
public HomeController(HomeService homeService) {
23+
this.homeService = homeService;
24+
}
25+
2426
/**
2527
* Get the top 5 tags.
2628
*

server/src/main/java/br/com/tasknoteapp/server/controller/NoteController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import io.swagger.v3.oas.annotations.tags.Tag;
1616
import jakarta.validation.Valid;
1717
import java.util.List;
18-
import lombok.AllArgsConstructor;
1918
import org.springframework.http.HttpStatus;
2019
import org.springframework.http.ResponseEntity;
2120
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -30,12 +29,15 @@
3029
/** This class provides resources to handle notes requests by the client. */
3130
@RestController
3231
@RequestMapping("/rest/notes")
33-
@AllArgsConstructor
3432
@Tag(name = "Notes", description = "Notes resources to handle stored notes.")
3533
public class NoteController {
3634

3735
private final NoteService noteService;
3836

37+
public NoteController(NoteService noteService) {
38+
this.noteService = noteService;
39+
}
40+
3941
/**
4042
* Get all notes.
4143
*

server/src/main/java/br/com/tasknoteapp/server/controller/TaskController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import io.swagger.v3.oas.annotations.tags.Tag;
1515
import jakarta.validation.Valid;
1616
import java.util.List;
17-
import lombok.AllArgsConstructor;
1817
import org.springframework.http.HttpStatus;
1918
import org.springframework.http.ResponseEntity;
2019
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -30,11 +29,14 @@
3029
@RestController
3130
@RequestMapping("/rest/tasks")
3231
@Tag(name = "Tasks", description = "Tasks resources to handle user tasks and urls.")
33-
@AllArgsConstructor
3432
public class TaskController {
3533

3634
private final TaskService taskService;
3735

36+
public TaskController(TaskService taskService) {
37+
this.taskService = taskService;
38+
}
39+
3840
/**
3941
* Get all tasks.
4042
*

server/src/main/java/br/com/tasknoteapp/server/controller/UserController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.swagger.v3.oas.annotations.tags.Tag;
1111
import jakarta.validation.Valid;
1212
import java.util.List;
13-
import lombok.AllArgsConstructor;
1413
import org.springframework.http.ResponseEntity;
1514
import org.springframework.web.bind.annotation.GetMapping;
1615
import org.springframework.web.bind.annotation.PatchMapping;
@@ -21,12 +20,15 @@
2120
/** This class contains resources for handling users admin requests. */
2221
@RestController
2322
@RequestMapping("/rest/users")
24-
@AllArgsConstructor
2523
@Tag(name = "Users", description = "Users resources to handle stored users.")
2624
public class UserController {
2725

2826
private final AuthService authService;
2927

28+
public UserController(AuthService authService) {
29+
this.authService = authService;
30+
}
31+
3032
/**
3133
* Get all users.
3234
*

server/src/main/java/br/com/tasknoteapp/server/controller/UserSessionController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
import io.swagger.v3.oas.annotations.media.Schema;
1010
import io.swagger.v3.oas.annotations.responses.ApiResponse;
1111
import io.swagger.v3.oas.annotations.tags.Tag;
12-
import lombok.AllArgsConstructor;
13-
import lombok.extern.slf4j.Slf4j;
1412
import org.springframework.http.ResponseEntity;
1513
import org.springframework.web.bind.annotation.DeleteMapping;
1614
import org.springframework.web.bind.annotation.GetMapping;
1715
import org.springframework.web.bind.annotation.RequestMapping;
1816
import org.springframework.web.bind.annotation.RestController;
1917

2018
/** This class contains resources for handling user sessions. */
21-
@Slf4j
2219
@RestController
2320
@RequestMapping("/rest/user-sessions")
24-
@AllArgsConstructor
2521
@Tag(name = "User Sessions", description = "Resources to handle user sessions.")
2622
public class UserSessionController {
2723

2824
private final UserSessionService userSessionService;
2925

26+
public UserSessionController(UserSessionService userSessionService) {
27+
this.userSessionService = userSessionService;
28+
}
29+
3030
/**
3131
* Refresh an existing user session, generating a new token.
3232
*

server/src/main/java/br/com/tasknoteapp/server/entity/NoteEntity.java

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,10 @@
1111
import jakarta.persistence.OneToOne;
1212
import jakarta.persistence.Table;
1313
import java.time.LocalDateTime;
14-
import lombok.Data;
15-
import lombok.EqualsAndHashCode;
16-
import lombok.ToString;
1714

1815
/** This class represents a note in the database. */
19-
@Data
2016
@Entity
2117
@Table(name = "notes")
22-
@ToString
23-
@EqualsAndHashCode
2418
public class NoteEntity {
2519

2620
@Id
@@ -44,4 +38,96 @@ public class NoteEntity {
4438

4539
@Column(name = "last_update")
4640
private LocalDateTime lastUpdate;
41+
42+
public Long getId() {
43+
return id;
44+
}
45+
46+
public void setId(Long id) {
47+
this.id = id;
48+
}
49+
50+
public String getTitle() {
51+
return title;
52+
}
53+
54+
public void setTitle(String title) {
55+
this.title = title;
56+
}
57+
58+
public String getDescription() {
59+
return description;
60+
}
61+
62+
public void setDescription(String description) {
63+
this.description = description;
64+
}
65+
66+
public UserEntity getUser() {
67+
return user;
68+
}
69+
70+
public void setUser(UserEntity user) {
71+
this.user = user;
72+
}
73+
74+
public NoteUrlEntity getNoteUrl() {
75+
return noteUrl;
76+
}
77+
78+
public void setNoteUrl(NoteUrlEntity noteUrl) {
79+
this.noteUrl = noteUrl;
80+
}
81+
82+
public String getTag() {
83+
return tag;
84+
}
85+
86+
public void setTag(String tag) {
87+
this.tag = tag;
88+
}
89+
90+
public LocalDateTime getLastUpdate() {
91+
return lastUpdate;
92+
}
93+
94+
public void setLastUpdate(LocalDateTime lastUpdate) {
95+
this.lastUpdate = lastUpdate;
96+
}
97+
98+
@Override
99+
public boolean equals(Object o) {
100+
if (this == o) {
101+
return true;
102+
}
103+
if (o == null || getClass() != o.getClass()) {
104+
return false;
105+
}
106+
NoteEntity that = (NoteEntity) o;
107+
return id != null && id.equals(that.id);
108+
}
109+
110+
@Override
111+
public int hashCode() {
112+
return getClass().hashCode();
113+
}
114+
115+
@Override
116+
public String toString() {
117+
return "NoteEntity{"
118+
+ "id="
119+
+ id
120+
+ ", title='"
121+
+ title
122+
+ '\''
123+
+ ", description='"
124+
+ description
125+
+ '\''
126+
+ ", tag='"
127+
+ tag
128+
+ '\''
129+
+ ", lastUpdate="
130+
+ lastUpdate
131+
+ '}';
132+
}
47133
}

0 commit comments

Comments
 (0)