新增评论管理接口

This commit is contained in:
jinyu
2017-05-19 19:06:26 +08:00
parent 66417fdc8b
commit c53e0718ef
17 changed files with 3720 additions and 3192 deletions
@@ -719,6 +719,18 @@
<code>45059</code>
<text>有粉丝身上的标签数已经超过限制</text>
</error>
<error>
<code>45065</code>
<text>相同 clientmsgid 已存在群发记录,返回数据中带有已存在的群发任务的 msgid</text>
</error>
<error>
<code>45066</code>
<text>相同 clientmsgid 重试速度过快,请间隔1分钟重试</text>
</error>
<error>
<code>45067</code>
<text>clientmsgid 长度超过限制</text>
</error>
<error>
<code>45157</code>
<text>标签名非法,请注意不能和其他标签重名</text>
@@ -1655,6 +1667,61 @@
<code>86320</code>
<text>不合法的客服类型</text>
</error>
<error>
<code>45009</code>
<msg>reach max api daily quota limit</msg>
<text>没有剩余的调用次数</text>
</error>
<error>
<code>88000</code>
<msg>without comment privilege</msg>
<text>没有留言权限</text>
</error>
<error>
<code>88001</code>
<msg>msg_data is not exists</msg>
<text>该图文不存在</text>
</error>
<error>
<code>88002</code>
<msg>the article is limit for safety</msg>
<text>文章存在敏感信息</text>
</error>
<error>
<code>88003</code>
<msg>elected comment upper limit</msg>
<text>精选评论数已达上限</text>
</error>
<error>
<code>88004</code>
<msg>comment was deleted by user</msg>
<text>已被用户删除,无法精选</text>
</error>
<error>
<code>88005</code>
<msg>already reply</msg>
<text>该评论已回复</text>
</error>
<error>
<code>88007</code>
<msg>reply content beyond max len or content len is zero</msg>
<text>回复超过长度限制或为0</text>
</error>
<error>
<code>88008</code>
<msg>comment is not exists</msg>
<text>该评论不存在</text>
</error>
<error>
<code>88009</code>
<msg>reply is not exists</msg>
<text>该回复不存在</text>
</error>
<error>
<code>88010</code>
<msg>count range error. cout <= 0 or count > 50</msg>
<text>获取评论数目不合法</text>
</error>
<error>
<code>90001</code>
<text>未认证摇一摇周边</text>
@@ -22,129 +22,186 @@ import com.foxinmy.weixin4j.type.ButtonType;
*/
public class Button implements Serializable {
private static final long serialVersionUID = -6422234732203854866L;
private static final long serialVersionUID = -6422234732203854866L;
/**
* 菜单标题,不超过16个字节,子菜单不超过40个字节
*/
private String name;
/**
* 菜单类型 </br> <font color="red">
* 公众平台官网上能够设置的菜单类型有view、text、img、photo、video、voice </font>
*
* @see com.foxinmy.weixin4j.type.ButtonType
*/
private ButtonType type;
/**
* 菜单KEY值,根据type的类型而定</p> 通过公众平台设置的自定义菜单:</br> <li>text:保存文字; <li>
* img、voice:保存媒体ID <li>video:保存视频URL <li>
* news:保存图文消息媒体ID <li>view:保存链接URL
* <p>
* 使用API设置的自定义菜单:
* </p> <li>
* click、scancode_push、scancode_waitmsg、pic_sysphoto、pic_photo_or_album、
* pic_weixin、location_select:保存key <li>view:保存链接URL; <li>
* media_id、view_limited:保存媒体ID
*/
private String content;
/**
* 扩展属性,比如在公众平台设置菜单时的图文列表
*/
@JSONField(serialize = false, deserialize = false)
private Object extra;
/**
* 二级菜单数组,个数应为1~5个
*/
@JSONField(name = "sub_button")
private List<Button> subs;
/**
* 菜单标题,不超过16个字节,子菜单不超过40个字节
*/
private String name;
/**
* 菜单类型 </br>
* <font color="red"> 公众平台官网上能够设置的菜单类型有view、text、img、photo、video、voice
* </font>
*
* @see com.foxinmy.weixin4j.type.ButtonType
*/
private String type;
/**
* 菜单KEY值,根据type的类型而定
* </p>
* 通过公众平台设置的自定义菜单:</br>
* <li>text:保存文字;
* <li>img、voice:保存媒体ID
* <li>video:保存视频URL
* <li>news:保存图文消息媒体ID
* <li>view:保存链接URL
* <p>
* 使用API设置的自定义菜单:
* </p>
* <li>click、scancode_push、scancode_waitmsg、pic_sysphoto、pic_photo_or_album、
* pic_weixin、location_select:保存key
* <li>view:保存链接URL;
* <li>media_id、view_limited:保存媒体ID
*/
private String content;
/**
* 扩展属性,比如在公众平台设置菜单时的图文列表
*/
@JSONField(serialize = false, deserialize = false)
private Object extra;
/**
* miniprogram类型必须 小程序的appid(仅认证公众号可配置)
*/
private String appid;
/**
* miniprogram类型必须 小程序的页面路径
*/
private String pagepath;
protected Button() {
this.subs = new ArrayList<Button>();
}
/**
* 二级菜单数组,个数应为1~5个
*/
@JSONField(name = "sub_button")
private List<Button> subs;
/**
* 创建一个具有子菜单的菜单
*
* @param name
* 菜单名
* @param subButtons
* 二级菜单列表
*/
public Button(String name, Button... subButtons) {
this.name = name;
this.subs = new ArrayList<Button>(Arrays.asList(subButtons));
}
protected Button() {
this.subs = new ArrayList<Button>();
}
/**
* 创建一个普通菜单
*
* @param name
* 菜单名
* @param content
* 菜单内容
* @param type
* 菜单类型
*/
public Button(String name, String content, ButtonType type) {
this.name = name;
this.content = content;
this.type = type;
this.subs = new ArrayList<Button>();
}
/**
* 创建一个具有子菜单的菜单
*
* @param name
* 菜单名
* @param subButtons
* 二级菜单列表
*/
public Button(String name, Button... subButtons) {
this.name = name;
this.subs = new ArrayList<Button>(Arrays.asList(subButtons));
}
public String getName() {
return name;
}
/**
* 创建一个普通菜单
*
* @param name
* 菜单名
* @param content
* 菜单内容
* @param type
* 菜单类型
*/
public Button(String name, String content, ButtonType type) {
this.name = name;
this.content = content;
this.type = type.name();
this.subs = new ArrayList<Button>();
}
public void setName(String name) {
this.name = name;
}
/**
* 小程序菜单
*
* @param name
* 菜单名
* @param url
* 小程序的url页面
* @param appid
* 小程序的appid
* @param pagepath
* 小程序员的页面路径
*/
public Button(String name, String url, String appid, String pagepath) {
this.name = name;
this.content = url;
this.appid = appid;
this.pagepath = pagepath;
this.type = ButtonType.miniprogram.name();
this.subs = new ArrayList<Button>();
}
public ButtonType getType() {
return type;
}
public String getName() {
return name;
}
public void setType(ButtonType type) {
this.type = type;
}
public void setName(String name) {
this.name = name;
}
public String getContent() {
return content;
}
public String getType() {
return type;
}
public void setContent(String content) {
this.content = content;
}
public void setType(String type) {
this.type = type;
}
public Object getExtra() {
return extra;
}
public void setType(ButtonType type) {
this.type = type.name();
}
/**
* 扩展只读属性,设置无效
*
* @param extra
*/
public void setExtra(Object extra) {
this.extra = extra;
}
public String getContent() {
return content;
}
public List<Button> getSubs() {
return subs;
}
public void setContent(String content) {
this.content = content;
}
public void setSubs(List<Button> subs) {
this.subs = subs;
}
public Object getExtra() {
return extra;
}
public Button pushSub(Button btn) {
this.subs.add(btn);
return this;
}
/**
* 扩展只读属性,设置无效
*
* @param extra
*/
public void setExtra(Object extra) {
this.extra = extra;
}
@Override
public String toString() {
return "Button [name=" + name + ", type=" + type + ", content="
+ content + ", extra=" + extra + ", subs=" + subs + "]";
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid;
}
public String getPagepath() {
return pagepath;
}
public void setPagepath(String pagepath) {
this.pagepath = pagepath;
}
public List<Button> getSubs() {
return subs;
}
public void setSubs(List<Button> subs) {
this.subs = subs;
}
public Button pushSub(Button btn) {
this.subs.add(btn);
return this;
}
@Override
public String toString() {
return "Button [name=" + name + ", type=" + type + ", content=" + content + ", extra=" + extra + ", appid="
+ appid + ", pagepath=" + pagepath + ", subs=" + subs + "]";
}
}
@@ -8,42 +8,42 @@ import com.alibaba.fastjson.annotation.JSONField;
/**
* 卡券对象
* <p>
* <font color="red">可用于「群发消息」</font>
* <font color="red">可用于「群发消息」和「客服消息」</font>
* </p>
*
*
* @className Card
* @author jinyu(foxinmy@gmail.com)
* @date 2015年6月8日
* @since JDK 1.6
* @see
*/
public class Card implements MassTuple {
public class Card implements MassTuple, NotifyTuple {
private static final long serialVersionUID = 6119453633595102147L;
private static final long serialVersionUID = 6119453633595102147L;
@Override
public String getMessageType() {
return "wxcard";
}
@Override
public String getMessageType() {
return "wxcard";
}
/**
* 上传后的微信返回的媒体ID
*/
@JSONField(name = "card_id")
@XmlElement(name = "CardId")
private String cardId;
/**
* 上传后的微信返回的媒体ID
*/
@JSONField(name = "card_id")
@XmlElement(name = "CardId")
private String cardId;
@JSONCreator
public Card(@JSONField(name = "cardId") String cardId) {
this.cardId = cardId;
}
@JSONCreator
public Card(@JSONField(name = "cardId") String cardId) {
this.cardId = cardId;
}
public String getCardId() {
return cardId;
}
public String getCardId() {
return cardId;
}
@Override
public String toString() {
return "Card [cardId=" + cardId + "]";
}
@Override
public String toString() {
return "Card [cardId=" + cardId + "]";
}
}
@@ -14,153 +14,196 @@ import com.alibaba.fastjson.annotation.JSONField;
*/
public class MpArticle implements Serializable {
private static final long serialVersionUID = 5583479943661639234L;
private static final long serialVersionUID = 5583479943661639234L;
/**
* 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得 非空
*/
@JSONField(name = "thumb_media_id")
private String thumbMediaId;
/**
* 图文消息的封面图片的地址(不一定有,请关注thumbMediaId)
*/
@JSONField(name = "thumb_url")
private String thumbUrl;
/**
* 图文消息的作者 可为空
*/
private String author;
/**
* 图文消息的标题 非空
*/
private String title;
/**
* 图文页的URL 获取图文消息时,群发消息时填写无效。
*/
private String url;
/**
* 在图文消息页面点击“阅读原文”后的页面 可为空
*/
@JSONField(name = "content_source_url")
private String sourceUrl;
/**
* 图文消息页面的内容,支持HTML标签 非空
*/
private String content;
/**
* 图文消息的描述 可为空
*/
private String digest;
/**
* 是否显示封面,1为显示,0为不显示 可为空
*/
@JSONField(name = "show_cover_pic")
private String showCoverPic;
/**
* 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得 非空
*/
@JSONField(name = "thumb_media_id")
private String thumbMediaId;
/**
* 图文消息的封面图片的地址(不一定有,请关注thumbMediaId)
*/
@JSONField(name = "thumb_url")
private String thumbUrl;
/**
* 图文消息的作者 可为空
*/
private String author;
/**
* 图文消息的标题 非空
*/
private String title;
/**
* 图文页的URL 获取图文消息时,群发消息时填写无效。
*/
private String url;
/**
* 在图文消息页面点击“阅读原文”后的页面 可为空
*/
@JSONField(name = "content_source_url")
private String sourceUrl;
/**
* 图文消息页面的内容,支持HTML标签 非空
*/
private String content;
/**
* 图文消息的描述 可为空
*/
private String digest;
/**
* 是否显示封面,1为显示,0为不显示 可为空
*/
@JSONField(name = "show_cover_pic")
private String showCoverPic;
/**
* 是否打开评论,0不打开,1打开
*/
@JSONField(name = "need_open_comment")
private String openComment;
/**
* 是否粉丝才可评论,0所有人可评论,1粉丝才可评论
*/
@JSONField(name = "only_fans_can_comment")
private String onlyFansCanComment;
protected MpArticle() {
}
protected MpArticle() {
}
/**
* @param thumbMediaId
* 缩略图
* @param title
* 标题
* @param content
* 内容
*/
public MpArticle(String thumbMediaId, String title, String content) {
this.thumbMediaId = thumbMediaId;
this.title = title;
this.content = content;
}
/**
* @param thumbMediaId
* 缩略图
* @param title
* 标题
* @param content
* 内容
*/
public MpArticle(String thumbMediaId, String title, String content) {
this.thumbMediaId = thumbMediaId;
this.title = title;
this.content = content;
}
public String getThumbMediaId() {
return thumbMediaId;
}
public String getThumbMediaId() {
return thumbMediaId;
}
public void setThumbMediaId(String thumbMediaId) {
this.thumbMediaId = thumbMediaId;
}
public void setThumbMediaId(String thumbMediaId) {
this.thumbMediaId = thumbMediaId;
}
public String getThumbUrl() {
return thumbUrl;
}
public String getThumbUrl() {
return thumbUrl;
}
public void setThumbUrl(String thumbUrl) {
this.thumbUrl = thumbUrl;
}
public void setThumbUrl(String thumbUrl) {
this.thumbUrl = thumbUrl;
}
public String getAuthor() {
return author;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUrl() {
return url;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public void setUrl(String url) {
this.url = url;
}
public String getSourceUrl() {
return sourceUrl;
}
public String getSourceUrl() {
return sourceUrl;
}
public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
}
public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
}
public String getContent() {
return content;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public void setContent(String content) {
this.content = content;
}
public String getDigest() {
return digest;
}
public String getDigest() {
return digest;
}
public void setDigest(String digest) {
this.digest = digest;
}
public void setDigest(String digest) {
this.digest = digest;
}
public String getShowCoverPic() {
return showCoverPic;
}
public String getShowCoverPic() {
return showCoverPic;
}
public void setShowCoverPic(String showCoverPic) {
this.showCoverPic = showCoverPic;
}
public void setShowCoverPic(String showCoverPic) {
this.showCoverPic = showCoverPic;
}
public void setShowCoverPic(boolean showCoverPic) {
this.showCoverPic = showCoverPic ? "1" : "0";
}
public void setShowCoverPic(boolean showCoverPic) {
this.showCoverPic = showCoverPic ? "1" : "0";
}
@JSONField(serialize = false)
public boolean getFormatShowCoverPic() {
return this.showCoverPic != null && this.showCoverPic.equals("1");
}
@JSONField(serialize = false)
public boolean getFormatShowCoverPic() {
return this.showCoverPic != null && this.showCoverPic.equals("1");
}
@Override
public String toString() {
return "MpArticle [thumbMediaId=" + thumbMediaId + ", thumbUrl="
+ thumbUrl + ", author=" + author + ", title=" + title
+ ", sourceUrl=" + sourceUrl + ", content=" + content
+ ", url=" + url + ", digest=" + digest + ", showCoverPic="
+ showCoverPic + "]";
}
public void setOpenComment(boolean openComment) {
this.openComment = openComment ? "1" : "0";
}
public String getOpenComment() {
return openComment;
}
public void setOpenComment(String openComment) {
this.openComment = openComment;
}
public String getOnlyFansCanComment() {
return onlyFansCanComment;
}
public void setOnlyFansCanComment(String onlyFansCanComment) {
this.onlyFansCanComment = onlyFansCanComment;
}
@JSONField(serialize = false)
public boolean getFormatOpenComment() {
return this.openComment != null && this.openComment.equals("1");
}
public void setOnlyFansCanComment(boolean onlyFansCanComment) {
this.onlyFansCanComment = onlyFansCanComment ? "1" : "0";
}
@JSONField(serialize = false)
public boolean getFormatOnlyFansCanComment() {
return this.onlyFansCanComment != null && this.onlyFansCanComment.equals("1");
}
@Override
public String toString() {
return "MpArticle [thumbMediaId=" + thumbMediaId + ", thumbUrl=" + thumbUrl + ", author=" + author + ", title="
+ title + ", url=" + url + ", sourceUrl=" + sourceUrl + ", content=" + content + ", digest=" + digest
+ ", showCoverPic=" + showCoverPic + ", openComment=" + openComment + ", onlyFansCanComment="
+ onlyFansCanComment + "]";
}
}
@@ -66,9 +66,5 @@ public enum ButtonType {
/**
* 小程序
*/
miniprogram,
/**
* 以下类型请勿使用,在公众平台设置的按钮类型,如果尝试使用API方式创建菜单则会出错。
*/
popups,text,img,voice,video,news;
miniprogram;
}