|
| 1 | +package me.chanjar.weixin.open.bean.result; |
| 2 | + |
| 3 | +import com.google.gson.annotations.SerializedName; |
| 4 | +import lombok.Data; |
| 5 | +import lombok.EqualsAndHashCode; |
| 6 | +import me.chanjar.weixin.open.util.json.WxOpenGsonBuilder; |
| 7 | + |
| 8 | +import java.io.Serializable; |
| 9 | +import java.util.List; |
| 10 | + |
| 11 | +/** |
| 12 | + * 获取类目名称信息的返回结果. |
| 13 | + * <p> |
| 14 | + * 用于获取所有小程序类目的 ID 和名称信息,包括一级类目和二级类目。 |
| 15 | + * </p> |
| 16 | + * |
| 17 | + * @author <a href="https://github.com/binarywang">Binary Wang</a> |
| 18 | + * @see <a href="https://developers.weixin.qq.com/doc/oplatform/openApi/miniprogram-management/category-management/api_getallcategoryname.html">官方文档</a> |
| 19 | + */ |
| 20 | +@Data |
| 21 | +@EqualsAndHashCode(callSuper = true) |
| 22 | +public class WxOpenMaCategoryNameListResult extends WxOpenResult { |
| 23 | + private static final long serialVersionUID = 8989721350285449879L; |
| 24 | + |
| 25 | + /** |
| 26 | + * 类目名称列表. |
| 27 | + */ |
| 28 | + @SerializedName("category_name_list") |
| 29 | + private List<CategoryName> categoryNameList; |
| 30 | + |
| 31 | + @Override |
| 32 | + public String toString() { |
| 33 | + return WxOpenGsonBuilder.create().toJson(this); |
| 34 | + } |
| 35 | + |
| 36 | + /** |
| 37 | + * 类目名称信息. |
| 38 | + * <p> |
| 39 | + * 包含一级类目和二级类目的 ID 和名称。 |
| 40 | + * </p> |
| 41 | + */ |
| 42 | + @Data |
| 43 | + public static class CategoryName implements Serializable { |
| 44 | + private static final long serialVersionUID = 8989721350285449880L; |
| 45 | + |
| 46 | + /** |
| 47 | + * 一级类目ID. |
| 48 | + */ |
| 49 | + @SerializedName("first_id") |
| 50 | + private Integer firstId; |
| 51 | + |
| 52 | + /** |
| 53 | + * 一级类目名称. |
| 54 | + */ |
| 55 | + @SerializedName("first_name") |
| 56 | + private String firstName; |
| 57 | + |
| 58 | + /** |
| 59 | + * 二级类目ID. |
| 60 | + */ |
| 61 | + @SerializedName("second_id") |
| 62 | + private Integer secondId; |
| 63 | + |
| 64 | + /** |
| 65 | + * 二级类目名称. |
| 66 | + */ |
| 67 | + @SerializedName("second_name") |
| 68 | + private String secondName; |
| 69 | + |
| 70 | + @Override |
| 71 | + public String toString() { |
| 72 | + return WxOpenGsonBuilder.create().toJson(this); |
| 73 | + } |
| 74 | + } |
| 75 | +} |
0 commit comments