2026-06-24 f4bd1f3c89d906131495a0aca5aaf82966378510
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
package cn.iocoder.yudao.module.mp.dal.dataobject.material;
 
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import me.chanjar.weixin.common.api.WxConsts;
 
/**
 * 公众号素材 DO
 *
 * 1. <a href="https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html">临时素材</a>
 * 2. <a href="https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Adding_Permanent_Assets.html">永久素材</a>
 *
 * @author 芋道源码
 */
@TableName("mp_material")
@KeySequence("mp_material_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MpMaterialDO extends BaseDO {
 
    /**
     * 主键
     */
    @TableId
    private Long id;
    /**
     * 公众号账号的编号
     *
     * 关联 {@link MpAccountDO#getId()}
     */
    private Long accountId;
    /**
     * 公众号 appId
     *
     * 冗余 {@link MpAccountDO#getAppId()}
     */
    private String appId;
 
    /**
     * 公众号素材 id
     */
    private String mediaId;
    /**
     * 文件类型
     *
     * 枚举 {@link WxConsts.MediaFileType}
     */
    private String type;
    /**
     * 是否永久
     *
     * true - 永久素材
     * false - 临时素材
     */
    private Boolean permanent;
    /**
     * 文件服务器的 URL
     */
    private String url;
 
    /**
     * 名字
     *
     * 永久素材:非空
     * 临时素材:可能为空。
     *      1. 为空的情况:粉丝主动发送的图片、语音等
     *      2. 非空的情况:主动发送给粉丝的图片、语音等
     */
    private String name;
 
    /**
     * 公众号文件 URL
     *
     * 只有【永久素材】使用
     */
    private String mpUrl;
 
    /**
     * 视频素材的标题
     *
     * 只有【永久素材】使用
     */
    private String title;
    /**
     * 视频素材的描述
     *
     * 只有【永久素材】使用
     */
    private String introduction;
 
}