mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 22:11:40 +08:00
图文素材相关类的属性中createdTime和updatedTime,改为createTime和updateTime,以便跟其他地方代码保持统一
This commit is contained in:
parent
b053ee666a
commit
23cb2104ad
@ -12,14 +12,16 @@ import lombok.Data;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
* 图文素材.
|
||||
*
|
||||
* @author codepiano
|
||||
*/
|
||||
@Data
|
||||
public class WxMpMaterialNews implements Serializable {
|
||||
private static final long serialVersionUID = -3283203652013494976L;
|
||||
|
||||
private Date createdTime;
|
||||
private Date updatedTime;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
private List<WxMpMaterialNewsArticle> articles = new ArrayList<>();
|
||||
|
||||
@ -46,7 +48,7 @@ public class WxMpMaterialNews implements Serializable {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 群发图文消息article
|
||||
* 群发图文消息article.
|
||||
* 1. thumbMediaId (必填) 图文消息的封面图片素材id(必须是永久mediaID)
|
||||
* 2. author 图文消息的作者
|
||||
* 3. title (必填) 图文消息的标题
|
||||
@ -64,52 +66,52 @@ public class WxMpMaterialNews implements Serializable {
|
||||
@Data
|
||||
public static class WxMpMaterialNewsArticle {
|
||||
/**
|
||||
* (必填) 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得
|
||||
* (必填) 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得.
|
||||
*/
|
||||
private String thumbMediaId;
|
||||
/**
|
||||
* 图文消息的封面url
|
||||
* 图文消息的封面url.
|
||||
*/
|
||||
private String thumbUrl;
|
||||
/**
|
||||
* 图文消息的作者
|
||||
* 图文消息的作者.
|
||||
*/
|
||||
private String author;
|
||||
/**
|
||||
* (必填) 图文消息的标题
|
||||
* (必填) 图文消息的标题.
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 在图文消息页面点击“阅读原文”后的页面链接
|
||||
* 在图文消息页面点击“阅读原文”后的页面链接.
|
||||
*/
|
||||
private String contentSourceUrl;
|
||||
/**
|
||||
* (必填) 图文消息页面的内容,支持HTML标签
|
||||
* (必填) 图文消息页面的内容,支持HTML标签.
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 图文消息的描述
|
||||
* 图文消息的描述.
|
||||
*/
|
||||
private String digest;
|
||||
/**
|
||||
* 是否显示封面,true为显示,false为不显示
|
||||
* 是否显示封面,true为显示,false为不显示.
|
||||
*/
|
||||
private boolean showCoverPic;
|
||||
|
||||
/**
|
||||
* 点击图文消息跳转链接
|
||||
* 点击图文消息跳转链接.
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* need_open_comment
|
||||
* 是否打开评论,0不打开,1打开
|
||||
* 是否打开评论,0不打开,1打开.
|
||||
*/
|
||||
private Boolean needOpenComment;
|
||||
|
||||
/**
|
||||
* only_fans_can_comment
|
||||
* 是否粉丝才可评论,0所有人可评论,1粉丝才可评论
|
||||
* 是否粉丝才可评论,0所有人可评论,1粉丝才可评论.
|
||||
*/
|
||||
private Boolean onlyFansCanComment;
|
||||
|
||||
|
@ -21,14 +21,14 @@ public class WxMpMaterialNewsGsonAdapter implements JsonSerializer<WxMpMaterialN
|
||||
}
|
||||
newsJson.add("articles", articleJsonArray);
|
||||
|
||||
if (wxMpMaterialNews.getCreatedTime() != null) {
|
||||
if (wxMpMaterialNews.getCreateTime() != null) {
|
||||
newsJson.addProperty("create_time",
|
||||
SimpleDateFormat.getDateTimeInstance().format(wxMpMaterialNews.getCreatedTime()));
|
||||
SimpleDateFormat.getDateTimeInstance().format(wxMpMaterialNews.getCreateTime()));
|
||||
}
|
||||
|
||||
if (wxMpMaterialNews.getUpdatedTime() != null) {
|
||||
if (wxMpMaterialNews.getUpdateTime() != null) {
|
||||
newsJson.addProperty("update_time",
|
||||
SimpleDateFormat.getDateTimeInstance().format(wxMpMaterialNews.getUpdatedTime()));
|
||||
SimpleDateFormat.getDateTimeInstance().format(wxMpMaterialNews.getUpdateTime()));
|
||||
}
|
||||
|
||||
return newsJson;
|
||||
@ -49,12 +49,12 @@ public class WxMpMaterialNewsGsonAdapter implements JsonSerializer<WxMpMaterialN
|
||||
|
||||
if (json.get("create_time") != null && !json.get("create_time").isJsonNull()) {
|
||||
Date createTime = new Date(GsonHelper.getAsLong(json.get("create_time"))* 1000);
|
||||
wxMpMaterialNews.setCreatedTime(createTime);
|
||||
wxMpMaterialNews.setCreateTime(createTime);
|
||||
}
|
||||
|
||||
if (json.get("update_time") != null && !json.get("update_time").isJsonNull()) {
|
||||
Date updateTime = new Date(GsonHelper.getAsLong(json.get("update_time"))* 1000);
|
||||
wxMpMaterialNews.setUpdatedTime(updateTime);
|
||||
wxMpMaterialNews.setUpdateTime(updateTime);
|
||||
}
|
||||
|
||||
return wxMpMaterialNews;
|
||||
|
Loading…
Reference in New Issue
Block a user