GetMenuResultFull.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #region Apache License Version 2.0
  2. /*----------------------------------------------------------------
  3. Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. except in compliance with the License. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software distributed under the
  8. License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  9. either express or implied. See the License for the specific language governing permissions
  10. and limitations under the License.
  11. Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
  12. ----------------------------------------------------------------*/
  13. #endregion Apache License Version 2.0
  14. /*----------------------------------------------------------------
  15. Copyright (C) 2019 Senparc
  16. 文件名:GetMenuResultFull.cs
  17. 文件功能描述:获取菜单时候的完整结构,用于接收微信服务器返回的Json信息
  18. 创建标识:Senparc - 20150211
  19. 修改标识:Senparc - 20150303
  20. 修改描述:整理接口
  21. ----------------------------------------------------------------*/
  22. using System.Collections.Generic;
  23. using Senparc.Weixin.Entities;
  24. using Senparc.Weixin.MP.AdvancedAPIs.AutoReply;
  25. using Senparc.Weixin.MP.Entities.Menu;
  26. namespace Senparc.Weixin.MP
  27. {
  28. #region GetMenuResultFull 相关
  29. /// <summary>
  30. /// 获取菜单时候的完整结构,用于接收微信服务器返回的Json信息
  31. /// 注:menu为默认菜单,conditionalmenu为个性化菜单列表。字段说明请见个性化菜单接口页的说明。
  32. /// </summary>
  33. public class GetMenuResultFull : WxJsonResult
  34. {
  35. public MenuFull_ButtonGroup menu { get; set; }
  36. /// <summary>
  37. /// 有个性化菜单时显示。最新的在最前。
  38. /// </summary>
  39. public List<MenuFull_ConditionalButtonGroup> conditionalmenu { get; set; }
  40. }
  41. public class MenuFull_ButtonGroup
  42. {
  43. public List<MenuFull_RootButton> button { get; set; }
  44. }
  45. public class MenuFull_RootButton
  46. {
  47. public string type { get; set; }
  48. public string key { get; set; }
  49. public string name { get; set; }
  50. public string url { get; set; }
  51. public NewsInfo news_info { get; set; }
  52. #region 小程序
  53. public string appid { get; set; }
  54. public string pagepath { get; set; }
  55. #endregion
  56. public string media_id { get; set; }
  57. public List<MenuFull_RootButton> sub_button { get; set; }
  58. }
  59. #endregion
  60. #region Conditional(个性化菜单)相关
  61. public class MenuTryMatchResult : WxJsonResult
  62. {
  63. public List<MenuFull_RootButton> button { get; set; }
  64. }
  65. /// <summary>
  66. /// 自定义菜单配置
  67. /// </summary>
  68. public class SelfMenuConfigResult : WxJsonResult
  69. {
  70. /// <summary>
  71. /// 菜单是否开启,0代表未开启,1代表开启
  72. /// </summary>
  73. public bool is_menu_open { get; set; }
  74. /// <summary>
  75. /// 菜单信息
  76. /// </summary>
  77. public MenuFull_ButtonGroup selfmenu_info { get; set; }
  78. }
  79. /// <summary>
  80. /// 接收菜单信息时用的“最大可能性”类型
  81. /// </summary>
  82. public class MenuFull_ConditionalButtonGroup: MenuFull_ButtonGroup
  83. {
  84. public MenuMatchRule matchrule { get; set; }
  85. /// <summary>
  86. /// 菜单Id,只在获取的时候自动填充,提交“菜单创建”请求时不需要设置
  87. /// </summary>
  88. public long menuid { get; set; }
  89. }
  90. #endregion
  91. }