package com.ltkj.tduck.domain;
|
|
import cn.hutool.core.util.StrUtil;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.ltkj.tduck.enums.FormSourceTypeEnum;
|
import com.ltkj.tduck.enums.FormStatusEnum;
|
import com.ltkj.tduck.utils.HtmlUtils;
|
import lombok.Data;
|
import lombok.experimental.FieldNameConstants;
|
import org.apache.ibatis.type.BooleanTypeHandler;
|
|
import javax.validation.constraints.NotBlank;
|
import java.util.Date;
|
|
/**
|
* 用户表单表(Form)表实体类
|
*/
|
@Data
|
@FieldNameConstants
|
@TableName(value = "fm_user_form", autoResultMap = true)
|
public class UserFormEntity{
|
|
/**
|
* 主键 避免超出长度 前端丢失精度
|
*/
|
private Long id;
|
|
/**
|
* 创建时间
|
**/
|
protected Date createTime;
|
|
/**
|
* 更新时间
|
**/
|
protected Date updateTime;
|
|
/**
|
* 表单code
|
*/
|
@NotBlank(message = "错误请求")
|
private String formKey;
|
/**
|
* 表单名称
|
*/
|
@NotBlank(message = "表单名称不能为空")
|
private String name;
|
/**
|
* 表单描述
|
*/
|
private String description;
|
|
|
/**
|
* 表单来源
|
*/
|
private Integer sourceType;
|
|
/**
|
* 来源ID
|
*/
|
private String sourceId;
|
|
/**
|
* 用户ID
|
*/
|
private Long userId;
|
|
/***
|
* 状态
|
*/
|
private Integer status;
|
/**
|
* 表单类型
|
*/
|
private String type;
|
|
@TableField(value = "is_deleted", typeHandler = BooleanTypeHandler.class)
|
private Boolean deleted;
|
|
/**
|
* 是否是文件夹
|
*/
|
@TableField(value = "is_folder", typeHandler = BooleanTypeHandler.class)
|
private Boolean folder;
|
/**
|
* 父级文件夹ID
|
*/
|
private Long folderId;
|
|
|
/**
|
* 移除html标签
|
* @return 文本
|
*/
|
public String getTextName() {
|
if (StrUtil.isBlank(name)) {
|
return null;
|
}
|
// 标题是富文本 去除html 标签
|
return HtmlUtils.cleanHtmlTag(name);
|
}
|
}
|