审计记录

src/org/theyeasy/weixin/builder/button.java 6.0 KB
zxt@theyeasy.com committed
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
package org.theyeasy.weixin.builder;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.common.util.ToStringUtils;

public class button {

	    /**
	     * <pre>
	     * 菜单的类型,公众平台官网上能够设置的菜单类型有view(跳转网页)、text(返回文本,下同)、img、photo、video、voice。
	     * 使用API设置的则有8种,详见<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN">《自定义菜单创建接口》</a>
	     * </pre>
	     */
	    @SerializedName("type")
	    private String type;

	    /**
	     * 菜单名称
	     */
	    @SerializedName("name")
	    private String name;

	    /**
	     * <pre>
	     * 对于不同的菜单类型,value的值意义不同。
	     * 官网上设置的自定义菜单:
	     *  <li>Text:保存文字到value;
	     *  <li>Img、voice:保存mediaID到value;
	     *  <li>Video:保存视频下载链接到value;
	     *  <li>News:保存图文消息到news_info,同时保存mediaID到value;
	     *  <li>View:保存链接到url。</li>
	     *
	     * 使用API设置的自定义菜单:
	     *  <li>click、scancode_push、scancode_waitmsg、pic_sysphoto、pic_photo_or_album、	pic_weixin、location_select:保存值到key;
	     *  <li>view:保存链接到url
	     *  </pre>
	     */
	    @SerializedName("key")
	    private String key;

	    /**
	     * @see #key
	     */
	    @SerializedName("url")
	    private String url;

	    /**
	     * @see #key
	     */
	    @SerializedName("value")
	    private String value;

	    /**
	     * 子菜单信息
	     */
	    @SerializedName("sub_button")
	    private SubButtons subButtons;

	    public SubButtons getSubButtons() {
	      return subButtons;
	    }

	    public void setSubButtons(SubButtons subButtons) {
	      this.subButtons = subButtons;
	    }

	    public static class SubButtons {
	      @Override
	      public String toString() {
	        return ToStringUtils.toSimpleString(this);
	      }

	      @SerializedName("list")
	      private List<button> subButtons = new ArrayList<>();

	      public List<button> getSubButtons() {
	        return subButtons;
	      }

	      public void setSubButtons(List<button> subButtons) {
	        this.subButtons = subButtons;
	      }
	    }

	    /**
	     * 图文消息的信息
	     */
	    @SerializedName("news_info")
	    private NewsInfo newsInfo;

	    public String getType() {
	      return type;
	    }

	    public void setType(String type) {
	      this.type = type;
	    }

	    public String getName() {
	      return name;
	    }

	    public void setName(String name) {
	      this.name = name;
	    }

	    public String getKey() {
	      return key;
	    }

	    public void setKey(String key) {
	      this.key = key;
	    }

	    public String getUrl() {
	      return url;
	    }

	    public void setUrl(String url) {
	      this.url = url;
	    }

	    public String getValue() {
	      return value;
	    }

	    public void setValue(String value) {
	      this.value = value;
	    }

	    public NewsInfo getNewsInfo() {
	      return newsInfo;
	    }

	    public void setNewsInfo(NewsInfo newsInfo) {
	      this.newsInfo = newsInfo;
	    }

	    public static class NewsInfo {
	      @Override
	      public String toString() {
	        return ToStringUtils.toSimpleString(this);
	      }

	      @SerializedName("list")
	      private List<NewsInButton> news = new ArrayList<>();

	      public List<NewsInButton> getNews() {
	        return news;
	      }

	      public void setNews(List<NewsInButton> news) {
	        this.news = news;
	      }

	      public static class NewsInButton {
	        @Override
	        public String toString() {
	          return ToStringUtils.toSimpleString(this);
	        }

	        /**
	         * 图文消息的标题
	         */
	        @SerializedName("title")
	        private String title;

	        /**
	         * 摘要
	         */
	        @SerializedName("digest")
	        private String digest;

	        /**
	         * 作者
	         */
	        @SerializedName("author")
	        private String author;

	        /**
	         * show_cover
	         * 是否显示封面,0为不显示,1为显示
	         */
	        @SerializedName("show_cover")
	        private Integer showCover;

	        /**
	         * 封面图片的URL
	         */
	        @SerializedName("cover_url")
	        private String coverUrl;

	        /**
	         * 正文的URL
	         */
	        @SerializedName("content_url")
	        private String contentUrl;

	        /**
	         * 原文的URL,若置空则无查看原文入口
	         */
	        @SerializedName("source_url")
	        private String sourceUrl;

	        public String getTitle() {
	          return title;
	        }

	        public void setTitle(String title) {
	          this.title = title;
	        }

	        public String getDigest() {
	          return digest;
	        }

	        public void setDigest(String digest) {
	          this.digest = digest;
	        }

	        public String getAuthor() {
	          return author;
	        }

	        public void setAuthor(String author) {
	          this.author = author;
	        }

	        public Integer getShowCover() {
	          return showCover;
	        }

	        public void setShowCover(Integer showCover) {
	          this.showCover = showCover;
	        }

	        public String getCoverUrl() {
	          return coverUrl;
	        }

	        public void setCoverUrl(String coverUrl) {
	          this.coverUrl = coverUrl;
	        }

	        public String getContentUrl() {
	          return contentUrl;
	        }

	        public void setContentUrl(String contentUrl) {
	          this.contentUrl = contentUrl;
	        }

	        public String getSourceUrl() {
	          return sourceUrl;
	        }

	        public void setSourceUrl(String sourceUrl) {
	          this.sourceUrl = sourceUrl;
	        }
	      }
	    }
}