ProductPostData.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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. 文件名:BaseProductData.cs
  17. 修改标识:Senparc - 20160805
  18. 修改描述:修改Property中参数的类型,将其int改为string
  19. 修改Attrext中参数的类型,将其bool改为int
  20. ----------------------------------------------------------------*/
  21. using System.Collections.Generic;
  22. namespace Senparc.Weixin.MP.AdvancedAPIs.MerChant
  23. {
  24. /// <summary>
  25. /// 商品信息
  26. /// </summary>
  27. public class BaseProductData
  28. {
  29. /// <summary>
  30. /// 基本属性
  31. /// </summary>
  32. public Product_base product_base { get; set; }
  33. /// <summary>
  34. /// sku信息列表(可为多个),每个sku信息串即为一个确定的商品,比如白色的37码的鞋子
  35. /// </summary>
  36. public List<Sku_list> sku_list { get; set; }
  37. /// <summary>
  38. /// 商品其他属性
  39. /// </summary>
  40. public Attrext attrext { get; set; }
  41. /// <summary>
  42. /// 运费信息
  43. /// </summary>
  44. public Delivery_info delivery_info { get; set; }
  45. }
  46. public class Product_base
  47. {
  48. /// <summary>
  49. /// 商品名称
  50. /// </summary>
  51. public string name { get; set; }
  52. /// <summary>
  53. /// 商品分类id
  54. /// </summary>
  55. public string[] category_id { get; set; }
  56. /// <summary>
  57. /// 商品图片列表
  58. /// </summary>
  59. public string[] img { get; set; }
  60. /// <summary>
  61. /// 商品详情列表,显示在客户端的商品详情页内
  62. /// </summary>
  63. public List<Detail> detail { get; set; }
  64. /// <summary>
  65. /// 商品属性列表
  66. /// </summary>
  67. public List<Property> property { get; set; }
  68. /// <summary>
  69. /// 商品sku定义
  70. /// </summary>
  71. public List<Sku_info> sku_info { get; set; }
  72. /// <summary>
  73. /// 用户商品限购数量
  74. /// </summary>
  75. public int buy_limit { get; set; }
  76. /// <summary>
  77. /// 商品主图
  78. /// </summary>
  79. public string main_img { get; set; }
  80. /// <summary>
  81. /// 详情
  82. /// </summary>
  83. public string detail_html { get; set; }
  84. }
  85. public class Property
  86. {
  87. /// <summary>
  88. /// 属性id 原来是int 改为string
  89. /// </summary>
  90. public string id { get; set; }
  91. /// <summary>
  92. /// 属性值id 原来是int 改为string
  93. /// </summary>
  94. public string vid { get; set; }
  95. }
  96. public class Sku_info
  97. {
  98. /// <summary>
  99. /// sku属性 原来是int 改为string
  100. /// </summary>
  101. public string id { get; set; }
  102. /// <summary>
  103. /// sku值 原来是int 改为string
  104. /// </summary>
  105. public string[] vid { get; set; }
  106. }
  107. public class Detail
  108. {
  109. /// <summary>
  110. /// 文字描述
  111. /// </summary>
  112. public string text { get; set; }
  113. /// <summary>
  114. /// 图片
  115. /// </summary>
  116. public string img { get; set; }
  117. }
  118. public class Sku_list
  119. {
  120. /// <summary>
  121. /// sku信息
  122. /// </summary>
  123. public string sku_id { get; set; }
  124. /// <summary>
  125. /// sku微信价(单位 : 分, 微信价必须比原价小, 否则添加商品失败)
  126. /// </summary>
  127. public int price { get; set; }
  128. /// <summary>
  129. /// sku iconurl(图片需调用图片上传接口获得图片Url)
  130. /// </summary>
  131. public string icon_url { get; set; }
  132. /// <summary>
  133. /// 商家商品编码
  134. /// </summary>
  135. public string product_code { get; set; }
  136. /// <summary>
  137. /// sku原价(单位 : 分)
  138. /// </summary>
  139. public int ori_price { get; set; }
  140. /// <summary>
  141. /// sku库存
  142. /// </summary>
  143. public int quantity { get; set; }
  144. }
  145. public class Attrext
  146. {
  147. /// <summary>
  148. /// 商品所在地地址
  149. /// </summary>
  150. public Location location { get; set; }
  151. /// <summary>
  152. /// 是否包邮(0-否, 1-是), 如果包邮delivery_info字段可省略
  153. /// </summary>
  154. public int isPostFree { get; set; }
  155. /// <summary>
  156. /// 是否提供发票(0-否, 1-是)
  157. /// </summary>
  158. public int isHasReceipt { get; set; }
  159. /// <summary>
  160. /// 是否保修(0-否, 1-是)
  161. /// </summary>
  162. public int isUnderGuaranty { get; set; }
  163. /// <summary>
  164. /// 是否支持退换货(0-否, 1-是)
  165. /// </summary>
  166. public int isSupportReplace { get; set; }
  167. }
  168. public class Location
  169. {
  170. /// <summary>
  171. /// 国家
  172. /// </summary>
  173. public string country { get; set; }
  174. /// <summary>
  175. /// 省份
  176. /// </summary>
  177. public string province { get; set; }
  178. /// <summary>
  179. /// 城市
  180. /// </summary>
  181. public string city { get; set; }
  182. /// <summary>
  183. /// 地址
  184. /// </summary>
  185. public string address { get; set; }
  186. }
  187. /// 快递列表(Id 说明)
  188. /// 10000027 平邮
  189. /// 10000028 快递
  190. /// 10000029 EMS
  191. public class Delivery_info
  192. {
  193. /// <summary>
  194. /// 运费类型(0-使用下面express字段的默认模板, 1-使用template_id代表的邮费模板)
  195. /// </summary>
  196. public int delivery_type { get; set; }
  197. /// <summary>
  198. /// 邮费模板ID
  199. /// </summary>
  200. public int template_id { get; set; }
  201. /// <summary>
  202. /// 快递信息
  203. /// </summary>
  204. public List<Express> express { get; set; }
  205. }
  206. public class Express
  207. {
  208. /// <summary>
  209. /// 快递ID
  210. /// </summary>
  211. public int id { get; set; }
  212. /// <summary>
  213. /// 运费(单位 : 分)
  214. /// </summary>
  215. public int price { get; set; }
  216. }
  217. /// <summary>
  218. /// 添加商品信息
  219. /// </summary>
  220. public class AddProductData : BaseProductData
  221. {
  222. }
  223. /// <summary>
  224. /// 修改商品信息
  225. /// </summary>
  226. public class UpdateProductData : BaseProductData
  227. {
  228. /// <summary>
  229. /// 商品ID
  230. /// </summary>
  231. public string product_id { get; set; }
  232. }
  233. }