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