请教个问题:数据库的createBy怎么关联起来的?
JakeWoki opened this issue · 3 comments
JakeWoki commented
@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"})
public abstract class XbootBaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@TableId
@ApiModelProperty(value = "唯一标识")
private String id = SnowFlakeUtil.nextId().toString();
@ApiModelProperty(value = "创建者")
@CreatedBy
@TableField(fill = FieldFill.INSERT)
private String createBy;
@CreatedDate
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新者")
@LastModifiedBy
@TableField(fill = FieldFill.UPDATE)
private String updateBy;
@LastModifiedDate
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.UPDATE)
private Date updateTime;
@ApiModelProperty(value = "删除标志 默认0")
private Integer delFlag = CommonConstant.STATUS_NORMAL;
}
createBy和cookie的userinfo的信息关联的吗?怎么关联的呢?不太懂
JakeWoki commented
文档的说明可以详细点
@ApiModelProperty(value = "手机")
@Pattern(regexp = NameUtil.regMobile, message = "11位手机号格式不正确")
private String mobile;
原来的
@ApiModelProperty(value = "手机", required = true)
@NotNull(message = "手机不能为空")
@Pattern(regexp = NameUtil.regMobile, message = "11位手机号格式不正确")
@Column(columnDefinition = "bigint(11) comment '手机'")
private BigInteger mobile;
增加其他说明
Exrick commented
百度 @createdby
sql注释后续可以考虑 但不应在代码中注释说明 已有文档注解
JakeWoki commented
昨天查知道了,谢谢。
api必填字段要的@ApiModelProperty(value = "手机", required = true)