更改 pojo-> Bot 的时区设置

This commit is contained in:
flykhan 2023-02-23 16:53:42 +08:00
parent 6a1aace1c0
commit 3de67ee47c
1 changed files with 6 additions and 5 deletions

View File

@ -14,21 +14,22 @@ import java.util.Date;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class Bot { public class Bot {
// 主键自增 // 主键自增
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Integer id; private Integer id;
// 注意在pojo中需要定义成userId在queryWrapper中的名称仍然为user_id // 注意在pojo中需要定义成userId在queryWrapper中的名称仍然为user_id
private Integer userId; private Integer userId;
private String title; private String title;
private String description; private String description;
private String content; private String content;
private Integer rating; private Integer rating;
// pojo中定义日期格式的注解@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // pojo中定义日期格式的注解@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // timezone 用于修改时区
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date createtime; private Date createtime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date modifytime; private Date modifytime;
} }