*/
public Result<Error> create(String accessToken, List<com.belerweb.social.weixin.bean.Menu> menus) {
JSONArray menuArray = new JSONArray();
for (com.belerweb.social.weixin.bean.Menu menu : menus) {
JSONObject obj = new JSONObject();
MenuType type = menu.getType();
obj.put("name", menu.getName());
if (type != null) {
obj.put("type", type.value());
if (type == MenuType.CLICK) {
obj.put("key", menu.getKey());
}
if (type == MenuType.VIEW) {
obj.put("view", menu.getUrl());
}
}
List<com.belerweb.social.weixin.bean.Menu> subs = menu.getSubs();
if (subs != null) {
JSONArray _menuArray = new JSONArray();
for (com.belerweb.social.weixin.bean.Menu _menu : subs) {
JSONObject _obj = new JSONObject();
MenuType _type = _menu.getType();
_obj.put("name", _menu.getName());
if (_type != null) {
_obj.put("type", _type.value());
if (_type == MenuType.CLICK) {
_obj.put("key", _menu.getKey());
}
if (_type == MenuType.VIEW) {
_obj.put("url", _menu.getUrl());