zhaowenxuan
2025-02-06 06c12d2b42c343798d9476be66031b48967df639
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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);
    }
}