Skip to content

Commit cbe3b22

Browse files
localDate added in modules
1 parent ef5cfad commit cbe3b22

File tree

6 files changed

+38
-4
lines changed

6 files changed

+38
-4
lines changed

BlogApp/src/main/java/com/BlogApp/module/Comments.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.BlogApp.module;
22

3+
import java.time.LocalDate;
4+
35
import javax.persistence.Entity;
46
import javax.persistence.GeneratedValue;
57
import javax.persistence.GenerationType;
@@ -23,6 +25,12 @@ public class Comments {
2325
@GeneratedValue(strategy = GenerationType.AUTO)
2426
private Integer commentId;
2527
private String commentBody;
28+
@JsonIgnore
29+
private LocalDate dateCreated;
30+
// timestamp edit
31+
@JsonIgnore
32+
private LocalDate dateModified;
33+
2634

2735
@JsonIgnore
2836
@ManyToOne

BlogApp/src/main/java/com/BlogApp/module/Connection.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.BlogApp.module;
22

3+
import java.time.LocalDate;
4+
35
import javax.persistence.Entity;
46
import javax.persistence.GeneratedValue;
57
import javax.persistence.GenerationType;
68
import javax.persistence.Id;
79
import javax.persistence.JoinColumn;
810
import javax.persistence.ManyToOne;
911

12+
import com.fasterxml.jackson.annotation.JsonIgnore;
13+
1014
import lombok.AllArgsConstructor;
1115
import lombok.Data;
1216
import lombok.NoArgsConstructor;
@@ -19,6 +23,12 @@ public class Connection {
1923
@GeneratedValue(strategy = GenerationType.AUTO)
2024
private Integer followerId;
2125

26+
@JsonIgnore
27+
private LocalDate dateFollowed;
28+
// timestamp edit
29+
@JsonIgnore
30+
private LocalDate dateUnfollowed;
31+
2232
@ManyToOne
2333
@JoinColumn(name = "user_id", referencedColumnName = "userId")
2434
private User follower;

BlogApp/src/main/java/com/BlogApp/module/CurrentSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ public class CurrentSession {
2424

2525
private String uuid;
2626

27-
private LocalDateTime localDateTime;
27+
private LocalDateTime loginTime;
2828
}

BlogApp/src/main/java/com/BlogApp/module/Post.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.BlogApp.module;
22

3+
import java.time.LocalDate;
34
import java.util.List;
45

56
import javax.persistence.CascadeType;
@@ -28,8 +29,11 @@ public class Post {
2829
private Integer postId;
2930
private String postHeading;
3031
private String postBody;
31-
// timestamp create
32+
@JsonIgnore
33+
private LocalDate dateCreated;
3234
// timestamp edit
35+
@JsonIgnore
36+
private LocalDate dateModified;
3337

3438
@JsonIgnore
3539
@ManyToOne

BlogApp/src/main/java/com/BlogApp/module/User.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.BlogApp.module;
22

3+
import java.time.LocalDate;
34
import java.util.List;
45

56
import javax.persistence.CascadeType;
@@ -49,7 +50,13 @@ public class User {
4950
// private LocalDate dateOfBirth;
5051

5152
// timestamp create
53+
@JsonIgnore
54+
private LocalDate dateCreated;
5255
// timestamp edit
56+
@JsonIgnore
57+
private LocalDate dateModified;
58+
59+
5360
@Email(message = "Please enter a valid email")
5461
@NotBlank(message = "Email filed can't be empty")
5562
private String email;

BlogApp/src/main/resources/application.properties

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
2+
3+
# MySql username and Password
4+
spring.datasource.username=root
5+
spring.datasource.password=root
6+
17
#changing the server port
28
server.port=8080
39

10+
411
#db specific properties
512
#change the MySQL username and Password
613
spring.datasource.url=jdbc:mysql://localhost:3306/blogApp
714
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
8-
spring.datasource.username=root
9-
spring.datasource.password=root
1015

1116
#ORM s/w specific properties
1217
spring.jpa.hibernate.ddl-auto=update

0 commit comments

Comments
 (0)