CardCreateInfo_Card.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. 文件名:CardCreateInfo_Card.cs
  17. 文件功能描述:卡券信息数据中的card字段
  18. 创建标识:Senparc - 20150211
  19. 修改标识:Senparc - 20150303
  20. 修改描述:整理接口
  21. 修改标识:Senparc - 20150323
  22. 修改描述:添加会议门票
  23. ----------------------------------------------------------------*/
  24. namespace Senparc.Weixin.MP.AdvancedAPIs.Card
  25. {
  26. /// <summary>
  27. /// 卡券信息数据中的card字段
  28. /// </summary>
  29. public class CardCreateInfo_Card
  30. {
  31. public string card_type { get; set; }
  32. }
  33. #region 不同卡券类型对应的信息
  34. /// <summary>
  35. /// 通用券
  36. /// </summary>
  37. public class Card_GeneralCoupon : CardCreateInfo_Card
  38. {
  39. public Card_GeneralCouponData general_coupon { get; set; }
  40. }
  41. /// <summary>
  42. /// 团购券
  43. /// </summary>
  44. public class Card_Groupon : CardCreateInfo_Card
  45. {
  46. public Card_GrouponData groupon { get; set; }
  47. }
  48. /// <summary>
  49. /// 礼品券
  50. /// </summary>
  51. public class Card_Gift : CardCreateInfo_Card
  52. {
  53. public Card_GiftData gift { get; set; }
  54. }
  55. /// <summary>
  56. /// 代金券
  57. /// </summary>
  58. public class Card_Cash : CardCreateInfo_Card
  59. {
  60. public Card_CashData cash { get; set; }
  61. }
  62. /// <summary>
  63. /// 折扣券
  64. /// </summary>
  65. public class Card_DisCount : CardCreateInfo_Card
  66. {
  67. public Card_DisCountData discount { get; set; }
  68. }
  69. /// <summary>
  70. /// 会员卡
  71. /// </summary>
  72. public class Card_MemberCard : CardCreateInfo_Card
  73. {
  74. public Card_MemberCardData member_card { get; set; }
  75. }
  76. /// <summary>
  77. /// 门票
  78. /// </summary>
  79. public class Card_ScenicTicket : CardCreateInfo_Card
  80. {
  81. public Card_ScenicTicketData scenic_ticket { get; set; }
  82. }
  83. /// <summary>
  84. /// 电影票
  85. /// </summary>
  86. public class Card_MovieTicket : CardCreateInfo_Card
  87. {
  88. public Card_MovieTicketData movie_ticket { get; set; }
  89. }
  90. /// <summary>
  91. /// 飞机票
  92. /// </summary>
  93. public class Card_BoardingPass : CardCreateInfo_Card
  94. {
  95. public Card_BoardingPassData boarding_pass { get; set; }
  96. }
  97. /// <summary>
  98. /// 红包
  99. /// </summary>
  100. public class Card_LuckyMoney : CardCreateInfo_Card
  101. {
  102. public Card_LuckyMoneyData lucky_money { get; set; }
  103. }
  104. /// <summary>
  105. /// 会议门票
  106. /// </summary>
  107. public class Card_MeetingTicket : CardCreateInfo_Card
  108. {
  109. public Card_MeetingTicketData meeting_ticket { get; set; }
  110. }
  111. #endregion
  112. public abstract class BaseCardInfo
  113. {
  114. /// <summary>
  115. /// 基本的卡券数据
  116. /// </summary>
  117. public Card_BaseInfoBase base_info { get; set; }
  118. /// <summary>
  119. /// 卡类型(不在Json数据中)
  120. /// </summary>
  121. protected CardType CardType { get; set; }
  122. public CardType GetCardType()
  123. {
  124. return CardType;
  125. }
  126. public BaseCardInfo(CardType cardType)
  127. {
  128. CardType = cardType;
  129. }
  130. }
  131. }