|
| 1 | +package me.chanjar.weixin.mp.bean.template; |
| 2 | + |
| 3 | +import java.util.List; |
| 4 | + |
| 5 | +import org.apache.commons.lang3.builder.ToStringBuilder; |
| 6 | +import org.apache.commons.lang3.builder.ToStringStyle; |
| 7 | + |
| 8 | +import com.google.gson.JsonParser; |
| 9 | +import com.google.gson.annotations.SerializedName; |
| 10 | +import com.google.gson.reflect.TypeToken; |
| 11 | + |
| 12 | +import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; |
| 13 | + |
| 14 | +/** |
| 15 | + * <pre> |
| 16 | + * 模板列表信息 |
| 17 | + * Created by Binary Wang on 2016-10-17. |
| 18 | + * @author <a href="https://github.com/binarywang">binarywang(Binary Wang)</a> |
| 19 | + * </pre> |
| 20 | + */ |
| 21 | +public class WxMpTemplate { |
| 22 | + |
| 23 | + private static final JsonParser JSON_PARSER = new JsonParser(); |
| 24 | + |
| 25 | + public static List<WxMpTemplate> fromJson(String json) { |
| 26 | + return WxMpGsonBuilder.create().fromJson(JSON_PARSER.parse(json).getAsJsonObject().get("template_list"), |
| 27 | + new TypeToken<List<WxMpTemplate>>() { |
| 28 | + }.getType()); |
| 29 | + } |
| 30 | + |
| 31 | + @Override |
| 32 | + public String toString() { |
| 33 | + return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * template_id |
| 38 | + * 模板ID |
| 39 | + */ |
| 40 | + @SerializedName("template_id") |
| 41 | + private String templateId; |
| 42 | + |
| 43 | + /** |
| 44 | + * title |
| 45 | + * 模板标题 |
| 46 | + */ |
| 47 | + @SerializedName("title") |
| 48 | + private String title; |
| 49 | + |
| 50 | + /** |
| 51 | + * primary_industry |
| 52 | + * 模板所属行业的一级行业 |
| 53 | + */ |
| 54 | + @SerializedName("primary_industry") |
| 55 | + private String primaryIndustry; |
| 56 | + |
| 57 | + /** |
| 58 | + * deputy_industry |
| 59 | + * 模板所属行业的二级行业 |
| 60 | + */ |
| 61 | + @SerializedName("deputy_industry") |
| 62 | + private String deputyIndustry; |
| 63 | + |
| 64 | + /** |
| 65 | + * content |
| 66 | + * 模板内容 |
| 67 | + */ |
| 68 | + @SerializedName("content") |
| 69 | + private String content; |
| 70 | + |
| 71 | + /** |
| 72 | + * example |
| 73 | + * 模板示例 |
| 74 | + */ |
| 75 | + @SerializedName("example") |
| 76 | + private String example; |
| 77 | + |
| 78 | + public String getTemplateId() { |
| 79 | + return templateId; |
| 80 | + } |
| 81 | + |
| 82 | + public void setTemplateId(String templateId) { |
| 83 | + this.templateId = templateId; |
| 84 | + } |
| 85 | + |
| 86 | + public String getTitle() { |
| 87 | + return title; |
| 88 | + } |
| 89 | + |
| 90 | + public void setTitle(String title) { |
| 91 | + this.title = title; |
| 92 | + } |
| 93 | + |
| 94 | + public String getPrimaryIndustry() { |
| 95 | + return primaryIndustry; |
| 96 | + } |
| 97 | + |
| 98 | + public void setPrimaryIndustry(String primaryIndustry) { |
| 99 | + this.primaryIndustry = primaryIndustry; |
| 100 | + } |
| 101 | + |
| 102 | + public String getDeputyIndustry() { |
| 103 | + return deputyIndustry; |
| 104 | + } |
| 105 | + |
| 106 | + public void setDeputyIndustry(String deputyIndustry) { |
| 107 | + this.deputyIndustry = deputyIndustry; |
| 108 | + } |
| 109 | + |
| 110 | + public String getContent() { |
| 111 | + return content; |
| 112 | + } |
| 113 | + |
| 114 | + public void setContent(String content) { |
| 115 | + this.content = content; |
| 116 | + } |
| 117 | + |
| 118 | + public String getExample() { |
| 119 | + return example; |
| 120 | + } |
| 121 | + |
| 122 | + public void setExample(String example) { |
| 123 | + this.example = example; |
| 124 | + } |
| 125 | + |
| 126 | +} |
0 commit comments