/// <summary> /// 添加定制个性化菜单 /// </summary> /// <param name="buttons"></param> /// <param name="rule"></param> /// <returns></returns> public WxAddCustomMenuResp AddCustomMenu(List <WxMenuButtonMo> buttons, WxMenuMatchRuleMo rule) { var req = new OsHttpRequest(); req.HttpMothed = HttpMothed.POST; req.AddressUrl = string.Concat(m_ApiUrl, "/cgi-bin/menu/addconditional"); req.CustomBody = JsonConvert.SerializeObject(new { button = buttons, matchrule = rule }, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); return(RestCommonOffcial <WxAddCustomMenuResp>(req)); }
/// <summary> /// 添加定制个性化菜单 /// </summary> /// <param name="buttons"></param> /// <param name="rule"></param> /// <returns></returns> public async Task <WxAddCustomMenuResp> AddCustomMenuAsync(List <WxMenuButtonMo> buttons, WxMenuMatchRuleMo rule) { var req = new OsHttpRequest { HttpMethod = HttpMethod.Post, AddressUrl = string.Concat(m_ApiUrl, "/cgi-bin/menu/addconditional"), CustomBody = JsonConvert.SerializeObject(new { button = buttons, matchrule = rule }, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }) }; return(await RestCommonOffcialAsync <WxAddCustomMenuResp>(req)); }