mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
polish code
This commit is contained in:
@@ -37,12 +37,12 @@ public class WxMpCustomMessage {
|
||||
/**
|
||||
* <pre>
|
||||
* 请使用
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#CUSTOM_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#CUSTOM_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#CUSTOM_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#CUSTOM_MSG_MUSIC}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#CUSTOM_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#CUSTOM_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_MUSIC}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#CUSTOM_MSG_NEWS}
|
||||
* </pre>
|
||||
* @param msgType
|
||||
*/
|
||||
|
||||
@@ -25,11 +25,11 @@ public class WxMpMassGroupMessage {
|
||||
/**
|
||||
* <pre>
|
||||
* 请使用
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VOICE}
|
||||
* 如果msgtype和media_id不匹配的话,会返回系统繁忙的错误
|
||||
* </pre>
|
||||
* @param msgtype
|
||||
|
||||
@@ -12,13 +12,13 @@ import java.util.List;
|
||||
*/
|
||||
public class WxMpMassNews {
|
||||
|
||||
private List<WxMassNewsArticle> articles = new ArrayList<WxMassNewsArticle>();
|
||||
private List<WxMpMassNewsArticle> articles = new ArrayList<WxMpMassNewsArticle>();
|
||||
|
||||
public List<WxMassNewsArticle> getArticles() {
|
||||
public List<WxMpMassNewsArticle> getArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
public void addArticle(WxMassNewsArticle article) {
|
||||
public void addArticle(WxMpMassNewsArticle article) {
|
||||
this.articles.add(article);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class WxMpMassNews {
|
||||
* @author chanjarster
|
||||
*
|
||||
*/
|
||||
public static class WxMassNewsArticle {
|
||||
public static class WxMpMassNewsArticle {
|
||||
/**
|
||||
* (必填) 图文消息缩略图的media_id,可以在基础支持-上传多媒体文件接口中获得
|
||||
*/
|
||||
|
||||
@@ -28,11 +28,11 @@ public class WxMpMassOpenIdsMessage {
|
||||
/**
|
||||
* <pre>
|
||||
* 请使用
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#MASS_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VOICE}
|
||||
* 如果msgtype和media_id不匹配的话,会返回系统繁忙的错误
|
||||
* </pre>
|
||||
* @param msgType
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.util.xml.MediaIdMarshaller;
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -18,7 +18,7 @@ public class WxMpMpXmlOutImageMessage extends WxMpXmlOutMessage {
|
||||
private String mediaId;
|
||||
|
||||
public WxMpMpXmlOutImageMessage() {
|
||||
this.msgType = WxMpConsts.XML_MSG_IMAGE;
|
||||
this.msgType = WxConsts.XML_MSG_IMAGE;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
|
||||
@@ -179,13 +179,13 @@ public class WxMpXmlMessage {
|
||||
/**
|
||||
* <pre>
|
||||
* 当接受用户消息时,可能会获得以下值:
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_LOCATION}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_LINK}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_EVENT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LOCATION}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_LINK}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_EVENT}
|
||||
* </pre>
|
||||
*
|
||||
* @return
|
||||
@@ -197,12 +197,12 @@ public class WxMpXmlMessage {
|
||||
/**
|
||||
* <pre>
|
||||
* 当发送消息的时候使用:
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.mp.api.WxMpConsts#XML_MSG_MUSIC}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_TEXT}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_IMAGE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VOICE}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_VIDEO}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_NEWS}
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#XML_MSG_MUSIC}
|
||||
* </pre>
|
||||
*
|
||||
* @param msgType
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.util.xml.AdapterCDATA;
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
|
||||
import javax.xml.bind.annotation.*;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
@@ -20,7 +20,7 @@ public class WxMpXmlOutMewsMessage extends WxMpXmlOutMessage {
|
||||
protected final List<Item> articles = new ArrayList<Item>();
|
||||
|
||||
public WxMpXmlOutMewsMessage() {
|
||||
this.msgType = WxMpConsts.XML_MSG_NEWS;
|
||||
this.msgType = WxConsts.XML_MSG_NEWS;
|
||||
}
|
||||
|
||||
public int getArticleCount() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.util.xml.AdapterCDATA;
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -17,7 +17,7 @@ public class WxMpXmlOutMusicMessage extends WxMpXmlOutMessage {
|
||||
protected final Music music = new Music();
|
||||
|
||||
public WxMpXmlOutMusicMessage() {
|
||||
this.msgType = WxMpConsts.XML_MSG_MUSIC;
|
||||
this.msgType = WxConsts.XML_MSG_MUSIC;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.util.xml.AdapterCDATA;
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -18,7 +18,7 @@ public class WxMpXmlOutTextMessage extends WxMpXmlOutMessage {
|
||||
private String content;
|
||||
|
||||
public WxMpXmlOutTextMessage() {
|
||||
this.msgType = WxMpConsts.XML_MSG_TEXT;
|
||||
this.msgType = WxConsts.XML_MSG_TEXT;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.util.xml.AdapterCDATA;
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -17,7 +17,7 @@ public class WxMpXmlOutVideoMessage extends WxMpXmlOutMessage {
|
||||
protected final Video video = new Video();
|
||||
|
||||
public WxMpXmlOutVideoMessage() {
|
||||
this.msgType = WxMpConsts.XML_MSG_VIDEO;
|
||||
this.msgType = WxConsts.XML_MSG_VIDEO;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.util.xml.MediaIdMarshaller;
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -18,7 +18,7 @@ public class WxMpXmlOutVoiceMessage extends WxMpXmlOutMessage {
|
||||
private String mediaId;
|
||||
|
||||
public WxMpXmlOutVoiceMessage() {
|
||||
this.msgType = WxMpConsts.XML_MSG_VOICE;
|
||||
this.msgType = WxConsts.XML_MSG_VOICE;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.custombuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class ImageBuilder extends BaseBuilder<ImageBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
public ImageBuilder() {
|
||||
this.msgType = WxMpConsts.CUSTOM_MSG_IMAGE;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_IMAGE;
|
||||
}
|
||||
|
||||
public ImageBuilder mediaId(String media_id) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.custombuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ public final class MusicBuilder extends BaseBuilder<MusicBuilder> {
|
||||
private String hqMusicUrl;
|
||||
|
||||
public MusicBuilder() {
|
||||
this.msgType = WxMpConsts.CUSTOM_MSG_MUSIC;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_MUSIC;
|
||||
}
|
||||
|
||||
public MusicBuilder musicUrl(String musicurl) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.custombuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -20,7 +20,7 @@ public final class NewsBuilder extends BaseBuilder<NewsBuilder> {
|
||||
private List<WxMpCustomMessage.WxArticle> articles = new ArrayList<WxMpCustomMessage.WxArticle>();
|
||||
|
||||
public NewsBuilder() {
|
||||
this.msgType = WxMpConsts.CUSTOM_MSG_NEWS;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_NEWS;
|
||||
}
|
||||
|
||||
public NewsBuilder addArticle(WxMpCustomMessage.WxArticle article) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.custombuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class TextBuilder extends BaseBuilder<TextBuilder> {
|
||||
private String content;
|
||||
|
||||
public TextBuilder() {
|
||||
this.msgType = WxMpConsts.CUSTOM_MSG_TEXT;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_TEXT;
|
||||
}
|
||||
|
||||
public TextBuilder content(String content) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.custombuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ public final class VideoBuilder extends BaseBuilder<VideoBuilder> {
|
||||
private String thumbMediaId;
|
||||
|
||||
public VideoBuilder() {
|
||||
this.msgType = WxMpConsts.CUSTOM_MSG_VIDEO;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_VIDEO;
|
||||
}
|
||||
|
||||
public VideoBuilder mediaId(String mediaId) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.custombuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpConsts;
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCustomMessage;
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ public final class VoiceBuilder extends BaseBuilder<VoiceBuilder> {
|
||||
private String mediaId;
|
||||
|
||||
public VoiceBuilder() {
|
||||
this.msgType = WxMpConsts.CUSTOM_MSG_VOICE;
|
||||
this.msgType = WxConsts.CUSTOM_MSG_VOICE;
|
||||
}
|
||||
|
||||
public VoiceBuilder mediaId(String media_id) {
|
||||
|
||||
Reference in New Issue
Block a user