package cn.stylefeng.team.form.modular.manage.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.team.form.api.pojo.FormDesignVo;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@TableName(value = "devops_form_template", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class FormTemplate extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long id;

    @TableField("template_name")
    @ChineseDescription("表单模板的名称")
    private String templateName;

    @TableField("template_code")
    @ChineseDescription("表单模板的编码")
    private String templateCode;

    @TableField("template_sort")
    @ChineseDescription("表单模板排序")
    private BigDecimal templateSort;

    @TableField(value = "form_config", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("PC端-表单配置的JSON")
    private FormDesignVo formConfig;

    @TableField(value = "mobile_form_config", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("移动端-表单配置的JSON")
    private FormDesignVo mobileFormConfig;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户id")
    private Long tenantId;

}