mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-24 18:04:38 +08:00
This commit is contained in:
parent
b885d2a1a9
commit
8254caf9ed
@ -28,11 +28,23 @@ public class WxMenu implements Serializable {
|
||||
public String toJson() {
|
||||
return WxGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 要用 http://mp.weixin.qq.com/wiki/16/ff9b7b85220e1396ffa16794a9d95adc.html 格式来反序列化
|
||||
* 相比 http://mp.weixin.qq.com/wiki/13/43de8269be54a0a6f64413e4dfa94f39.html 的格式,外层多套了一个menu
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
public static WxMenu fromJson(String json) {
|
||||
return WxGsonBuilder.create().fromJson(json, WxMenu.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 要用 http://mp.weixin.qq.com/wiki/16/ff9b7b85220e1396ffa16794a9d95adc.html 格式来反序列化
|
||||
* 相比 http://mp.weixin.qq.com/wiki/13/43de8269be54a0a6f64413e4dfa94f39.html 的格式,外层多套了一个menu
|
||||
* @param is
|
||||
* @return
|
||||
*/
|
||||
public static WxMenu fromJson(InputStream is) {
|
||||
return WxGsonBuilder.create().fromJson(new InputStreamReader(is), WxMenu.class);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user