Sfoglia il codice sorgente

时区问题 & 字段类型

master
nelson 4 anni fa
parent
commit
056a48bf8f
  1. 1
      src/main/java/com/aiprose/mbp/controller/UserController.java
  2. 5
      src/main/java/com/aiprose/mbp/entity/SuperEntity.java
  3. 2
      src/main/resources/application.yml

1
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;

5
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;
}

2
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:

Caricamento…
Annulla
Salva