package org.dromara.knowledge.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.knowledge.domain.KnowledgeSchemaField;

/**
 * 知识库数据模型字段业务对象 knowledge_schema_field
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = KnowledgeSchemaField.class, reverseConvertGenerate = false)
public class KnowledgeSchemaFieldBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 模型ID
     */
    @NotNull(message = "模型ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long schemaId;

    /**
     * 模型名称
     */
    private String schemaName;

    /**
     * 字段名称
     */
    @NotBlank(message = "字段名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String name;

    /**
     * 字段编码
     */
    @NotBlank(message = "字段编码不能为空", groups = {AddGroup.class, EditGroup.class})
    private String code;

    /**
     * 字段类型
     */
    @NotBlank(message = "字段类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String type;

    /**
     * 字段注释
     */
    private String comment;

    /**
     * 是否主键:0否,1是
     */
    private Integer isPk;

    /**
     * 是否必填:0否,1是
     */
    private Integer isRequired;

    /**
     * 是否唯一:0否,1是
     */
    private Integer isUnique;

    /**
     * 默认值
     */
    private String defaultValue;

    /**
     * 字段长度
     */
    private Integer length;

    /**
     * 小数位数
     */
    private Integer scale;

    /**
     * 是否列表:0否,1是
     */
    private Integer isList;

    /**
     * 是否查询:0否,1是
     */
    private Integer isQuery;

    /**
     * 是否插入:0否,1是
     */
    private Integer isInsert;

    /**
     * 是否编辑:0否,1是
     */
    private Integer isEdit;

    /**
     * 查询类型
     */
    private String queryType;

    /**
     * HTML类型
     */
    private String htmlType;

    /**
     * 字典类型
     */
    private String dictType;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 备注
     */
    private String remark;

}