官方菜单功能介绍
请求接口:https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN
新增菜单管理类
1 public class MenuFirstLayerModel 2 { 3 public string name { get; set; } 4 public List<MenuTwoLayerModel> sub_button { get; set; } 5 } 6 7 public class MenuTwoLayerModel 8 { 9 public string type { get; set; } 10 public string name { get; set; } 11 public string key { get; set; } 12 public string url { get; set; } 13 } 14 15 public class WXMenu 16 { 17 public List<MenuFirstLayerModel> button { get; set; } 18 19 public string Create() 20 { 21 try 22 { 23 var requestUri = string.Format(@"https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}", WeCharBase.AccessToken); 24 25 return WeCharBase.Post(requestUri, new StringContent(JsonConvert.SerializeObject(new 26 { 27 button = button 28 }))); 29 } 30 catch (Exception ex) 31 { 32 return ex.Message; 33 } 34 } 35 }