Commit ed47e58a356e275bb526d7efe80b84570d2c8192

Authored by badetitou
1 parent a0940d93

Better format Json DATE

src/main/java/etunicorn/entity/Personne.java
1 package etunicorn.entity; 1 package etunicorn.entity;
2 2
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +
3 import javax.persistence.*; 5 import javax.persistence.*;
4 import java.util.Date; 6 import java.util.Date;
5 7
@@ -50,6 +52,7 @@ public class Personne { @@ -50,6 +52,7 @@ public class Personne {
50 this.carte = carte; 52 this.carte = carte;
51 } 53 }
52 54
  55 + @JsonFormat(pattern="YYYY-MM-DD hh:mm:ss")
53 public Date getNaissance() { 56 public Date getNaissance() {
54 return naissance; 57 return naissance;
55 } 58 }
src/main/java/etunicorn/entity/Session.java
1 package etunicorn.entity; 1 package etunicorn.entity;
2 2
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +
3 import javax.persistence.Entity; 5 import javax.persistence.Entity;
4 import javax.persistence.Id; 6 import javax.persistence.Id;
5 import javax.persistence.ManyToOne; 7 import javax.persistence.ManyToOne;
@@ -58,6 +60,7 @@ public class Session { @@ -58,6 +60,7 @@ public class Session {
58 this.token = token; 60 this.token = token;
59 } 61 }
60 62
  63 + @JsonFormat(pattern="YYYY-MM-DD hh:mm:ss")
61 public Date getValidity() { 64 public Date getValidity() {
62 return validity; 65 return validity;
63 } 66 }