From 056a48bf8f9f764dd9361d7a4133386a8d37dc0c Mon Sep 17 00:00:00 2001 From: nelson Date: Thu, 3 Sep 2020 10:57:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E5=8C=BA=E9=97=AE=E9=A2=98=20&=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/aiprose/mbp/controller/UserController.java | 1 + src/main/java/com/aiprose/mbp/entity/SuperEntity.java | 5 +++-- src/main/resources/application.yml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/aiprose/mbp/controller/UserController.java b/src/main/java/com/aiprose/mbp/controller/UserController.java index a40f749..2a2828d 100644 --- a/src/main/java/com/aiprose/mbp/controller/UserController.java +++ b/src/main/java/com/aiprose/mbp/controller/UserController.java @@ -16,6 +16,7 @@ import java.util.List; @RestController @Api(tags = "用户接口-用户信息相关") public class UserController { + @Autowired private UserService userService; diff --git a/src/main/java/com/aiprose/mbp/entity/SuperEntity.java b/src/main/java/com/aiprose/mbp/entity/SuperEntity.java index 8f9cb8a..3769f97 100644 --- a/src/main/java/com/aiprose/mbp/entity/SuperEntity.java +++ b/src/main/java/com/aiprose/mbp/entity/SuperEntity.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.gitee.sunchenbin.mybatis.actable.annotation.Column; import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement; import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey; +import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; import lombok.Data; import java.io.Serializable; @@ -23,11 +24,11 @@ public class SuperEntity implements Serializable { /** * 创建时间 */ - @Column(name = "create_time",comment = "创建时间") // name指定数据库字段名,comment为备注 + @Column(name = "create_time",comment = "创建时间",type = MySqlTypeConstant.DATETIME) // name指定数据库字段名,comment为备注 private Date createTime = new Date(); /** * 最后修改时间 */ - @Column(name = "update_time",comment = "最后修改时间") + @Column(name = "update_time",comment = "最后修改时间",type = MySqlTypeConstant.DATETIME) private Date updateTime; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3ec5356..0b14888 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -4,7 +4,7 @@ server: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://47.98.109.5:3309/mbp?characterEncoding=utf8&useSSL=false + url: jdbc:mysql://47.98.109.5:3309/mbp?characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 username: root password: trgis hikari: