mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	change name: matchrule to matchRule
This commit is contained in:
		| @ -19,7 +19,7 @@ public class WxMenu implements Serializable { | |||||||
|  |  | ||||||
|   private List<WxMenuButton> buttons = new ArrayList<WxMenuButton>(); |   private List<WxMenuButton> buttons = new ArrayList<WxMenuButton>(); | ||||||
|  |  | ||||||
|   private WxMenuRule matchrule; |   private WxMenuRule matchRule; | ||||||
|    |    | ||||||
|   public List<WxMenuButton> getButtons() { |   public List<WxMenuButton> getButtons() { | ||||||
|     return buttons; |     return buttons; | ||||||
| @ -29,12 +29,12 @@ public class WxMenu implements Serializable { | |||||||
|     this.buttons = buttons; |     this.buttons = buttons; | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   public WxMenuRule getMatchrule() { |   public WxMenuRule getMatchRule() { | ||||||
|     return matchrule; |     return matchRule; | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   public void setMatchrule(WxMenuRule matchrule) { |   public void setMatchRule(WxMenuRule matchRule) { | ||||||
|     this.matchrule = matchrule; |     this.matchRule = matchRule; | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   public String toJson() { |   public String toJson() { | ||||||
|  | |||||||
| @ -39,9 +39,9 @@ public class WxMenuGsonAdapter implements JsonSerializer<WxMenu>, JsonDeserializ | |||||||
|     } |     } | ||||||
|     json.add("button", buttonArray); |     json.add("button", buttonArray); | ||||||
|      |      | ||||||
|     if (menu.getMatchrule() != null) { |     if (menu.getMatchRule() != null) { | ||||||
|       Gson gson = new Gson(); |       Gson gson = new Gson(); | ||||||
|     	json.add("matchrule", gson.toJsonTree(menu.getMatchrule())); |       json.add("matchrule", gson.toJsonTree(menu.getMatchRule())); | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     return json; |     return json; | ||||||
|  | |||||||
| @ -230,7 +230,7 @@ public class WxMpServiceImpl implements WxMpService { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   public void menuCreate(WxMenu menu) throws WxErrorException { |   public void menuCreate(WxMenu menu) throws WxErrorException { | ||||||
|     if (menu.getMatchrule() != null) { |     if (menu.getMatchRule() != null) { | ||||||
|       String url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional"; |       String url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional"; | ||||||
|       execute(new SimplePostRequestExecutor(), url, menu.toJson()); |       execute(new SimplePostRequestExecutor(), url, menu.toJson()); | ||||||
|     } else { |     } else { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Tianmu
					Tianmu