mysql字段

springboot配置
compile('com.vladmihalcea:hibernate-types-52:2.4.1')
@Getter
@Setter
@Entity(name = "opt_log")
@TypeDef(name = "json",typeClass = JsonStringType.class)
public class OptLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "ID")
private Long id;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "创建时间")
private Date creatTime;
@ApiModelProperty(value = "表ID")
private Integer tableId;
@ApiModelProperty(value = "表名称")
private String tableName;
@ApiModelProperty(value = "标题")
private String title;
@Type(type = "json")
@ApiModelProperty(value = "详情")
private JSONObject detail;
}
JSONObject
类型也可以换成自字义实体,并实现Serializable
接口
