File tree Expand file tree Collapse file tree 3 files changed +6
-16
lines changed
src/main/java/br/edu/ufrn/user Expand file tree Collapse file tree 3 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,12 @@ public class User {
1414 private Integer age ;
1515
1616 private Instant createdAt ;
17- private Instant updatedAt ;
1817
1918 public User (String name , Integer age ) {
2019 this .name = name ;
2120 this .age = age ;
2221
2322 this .createdAt = Instant .now ();
24- this .updatedAt = Instant .now ();
2523 }
2624
2725 public String getId () {
@@ -47,12 +45,5 @@ public void setAge(Integer age) {
4745 public Instant getCreatedAt () {
4846 return createdAt ;
4947 }
50-
51- public Instant getUpdatedAt () {
52- return updatedAt ;
53- }
54-
55- public void setUpdatedAt (Instant updatedAt ) {
56- this .updatedAt = updatedAt ;
57- }
48+
5849}
Original file line number Diff line number Diff line change @@ -9,6 +9,5 @@ public record UserDTO(
99 String id ,
1010 String name ,
1111 Integer age ,
12- @ JsonProperty ("created_at" ) @ JsonFormat (shape = JsonFormat .Shape .STRING ) Instant createdAt ,
13- @ JsonProperty ("updated_at" ) @ JsonFormat (shape = JsonFormat .Shape .STRING ) Instant updatedAt
12+ @ JsonProperty ("created_at" ) @ JsonFormat (shape = JsonFormat .Shape .STRING ) Instant createdAt
1413) {}
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ public Flux<UserDTO> getAll() {
2222 user .getId (),
2323 user .getName (),
2424 user .getAge (),
25- user .getCreatedAt (),
2625 user .getCreatedAt ()
2726 )
2827 );
@@ -35,22 +34,23 @@ public Mono<UserDTO> getById(String id) {
3534 user .getId (),
3635 user .getName (),
3736 user .getAge (),
38- user .getCreatedAt (),
3937 user .getCreatedAt ()
4038 )
4139 );
4240 }
4341
4442 public Mono <UserDTO > save (CreateUserDTO createUserDTO ) {
45- User userModel = new User (createUserDTO .name (), createUserDTO .age ());
43+ User userModel = new User (
44+ createUserDTO .name (),
45+ createUserDTO .age ()
46+ );
4647
4748 return userRepository .save (userModel )
4849 .map (
4950 user -> new UserDTO (
5051 user .getId (),
5152 user .getName (),
5253 user .getAge (),
53- user .getCreatedAt (),
5454 user .getCreatedAt ()
5555 )
5656 );
You can’t perform that action at this time.
0 commit comments