Przeglądaj źródła

返回时间格式化

hanqingsong 1 rok temu
rodzic
commit
3eddd2fd82

+ 4 - 0
src/main/java/com/chinaitop/depot/system/model/UserLoginLog.java

@@ -1,5 +1,7 @@
1 1
 package com.chinaitop.depot.system.model;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+
3 5
 import java.util.Date;
4 6
 
5 7
 public class UserLoginLog {
@@ -16,9 +18,11 @@ public class UserLoginLog {
16 18
     private String userIp;
17 19
 
18 20
     // 登陆时间
21
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
19 22
     private Date inLoginTime;
20 23
 
21 24
     // 注销时间
25
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
22 26
     private Date outLoginTime;
23 27
 
24 28
     // 退出登录更新标识

+ 3 - 0
src/main/java/com/chinaitop/depot/system/model/UserOperationPageLog.java

@@ -1,5 +1,7 @@
1 1
 package com.chinaitop.depot.system.model;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+
3 5
 import java.util.Date;
4 6
 
5 7
 public class UserOperationPageLog {
@@ -11,6 +13,7 @@ public class UserOperationPageLog {
11 13
 
12 14
     private String userIp;
13 15
 
16
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
14 17
     private Date visitPageTime;
15 18
 
16 19
     /**