Skip to content

Commit 4b52946

Browse files
author
Ivan Franchin
committed
project upgrade
- upgrade to Java 17; - upgrade to spring-boot 2.7.3; - upgrade to springdoc-openapi 1.6.11; - upgrade to mysql 8.0.30; - upgrade some npm packages; - refactor some classes to records; - update README.
1 parent af9bada commit 4b52946

File tree

8 files changed

+60
-148
lines changed

8 files changed

+60
-148
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The goal of this project is to implement an application called `order-app` to ma
3939
## Prerequisites
4040

4141
- [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
42-
- [`Java 11+`](https://www.oracle.com/java/technologies/downloads/#java11)
42+
- [`Java 17+`](https://www.oracle.com/java/technologies/downloads/#java17)
4343
- [`Docker`](https://www.docker.com/)
4444
- [`Docker-Compose`](https://docs.docker.com/compose/install/)
4545
- [`jq`](https://stedolan.github.io/jq)
@@ -83,10 +83,10 @@ The goal of this project is to implement an application called `order-app` to ma
8383
8484
## Applications URLs
8585
86-
| Application | URL | Credentials |
87-
| ----------- | ------------------------------------------- | --------------------------------------------------- |
88-
| order-api | http://localhost:8080/swagger-ui/index.html | |
89-
| order-ui | http://localhost:3000 | `admin/admin`, `user/user` or signing up a new user |
86+
| Application | URL | Credentials |
87+
| ----------- | ------------------------------------- | --------------------------------------------------- |
88+
| order-api | http://localhost:8080/swagger-ui.html | |
89+
| order-ui | http://localhost:3000 | `admin/admin`, `user/user` or signing up a new user |
9090
9191
> **Note**: the credentials shown in the table are the ones already pre-defined. You can signup new users
9292
@@ -104,7 +104,7 @@ The goal of this project is to implement an application called `order-app` to ma
104104
105105
- **Manual Endpoints Test using Swagger**
106106
107-
- Open a browser and access http://localhost:8080/swagger-ui/index.html. All endpoints with the lock sign are secured. In order to access them, you need a valid JWT access token.
107+
- Open a browser and access http://localhost:8080/swagger-ui.html. All endpoints with the lock sign are secured. In order to access them, you need a valid JWT access token.
108108
109109
- Click `POST /auth/authenticate` and then, click `Try it out` button
110110

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '3.8'
33
services:
44

55
mysql:
6-
image: mysql:8.0.29
6+
image: mysql:8.0.30
77
container_name: mysql
88
ports:
99
- "3306:3306"

order-api/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.springframework.boot</groupId>
66
<artifactId>spring-boot-starter-parent</artifactId>
7-
<version>2.7.1</version>
7+
<version>2.7.3</version>
88
<relativePath /> <!-- lookup parent from repository -->
99
</parent>
1010

@@ -15,11 +15,11 @@
1515
<description>Demo project for Spring Boot</description>
1616

1717
<properties>
18-
<java.version>11</java.version>
18+
<java.version>17</java.version>
1919
<jjwt.version>0.11.5</jjwt.version>
2020
<org.mapstruct.version>1.5.2.Final</org.mapstruct.version>
2121
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
22-
<springdoc-openapi.version>1.6.9</springdoc-openapi.version>
22+
<springdoc-openapi.version>1.6.11</springdoc-openapi.version>
2323
</properties>
2424

2525
<dependencies>
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
package com.ivanfranchin.orderapi.rest.dto;
22

3-
import lombok.AllArgsConstructor;
4-
import lombok.Data;
5-
6-
@Data
7-
@AllArgsConstructor
8-
public class AuthResponse {
9-
10-
private String accessToken;
3+
public record AuthResponse(String accessToken) {
114
}
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
package com.ivanfranchin.orderapi.rest.dto;
22

3-
import lombok.Data;
4-
53
import java.time.ZonedDateTime;
64

7-
@Data
8-
public class OrderDto {
9-
10-
private String id;
11-
private String description;
12-
private UserDto user;
13-
private ZonedDateTime createdAt;
5+
public record OrderDto(String id, String description, com.ivanfranchin.orderapi.rest.dto.OrderDto.UserDto user,
6+
ZonedDateTime createdAt) {
147

15-
@Data
16-
public static final class UserDto {
17-
private String username;
8+
public record UserDto(String username) {
189
}
1910
}
Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
package com.ivanfranchin.orderapi.rest.dto;
22

3-
import lombok.Data;
4-
53
import java.time.ZonedDateTime;
64
import java.util.List;
75

8-
@Data
9-
public class UserDto {
10-
11-
private Long id;
12-
private String username;
13-
private String name;
14-
private String email;
15-
private String role;
16-
private List<OrderDto> orders;
6+
public record UserDto(Long id, String username, String name, String email, String role, List<OrderDto> orders) {
177

18-
@Data
19-
public static final class OrderDto {
20-
private String id;
21-
private String description;
22-
private ZonedDateTime createdAt;
8+
public record OrderDto(String id, String description, ZonedDateTime createdAt) {
239
}
2410
}

0 commit comments

Comments
 (0)