package cn.stylefeng.team.meta.api.pojo.db.request;

import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class GenDatabaseFieldRequest extends BaseRequest {

    @NotNull(message = "字段id不能为空", groups = {edit.class, delete.class})
    private Long fieldId;

    @NotNull(message = "所属表id不能为空", groups = {add.class})
    private Long tableId;

    private String fieldName;

    @NotBlank(message = "字段编码不能为空", groups = {add.class, edit.class})
    private String fieldCode;

    @NotBlank(message = "字段类型不能为空", groups = {add.class, edit.class})
    private String fieldType;

    private Integer fieldLength;

    private Integer fieldDecimalPointLength;

    private String notNullFlag;

    private String primaryKeyFlag;

}
