TaobaoTbkDgMaterialRecommendRequest.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3. using Topsdk.Util;
  4. namespace Topsdk.Top.Defaultability.Request;
  5. public class TaobaoTbkDgMaterialRecommendRequest : AbstractTopApiRequest
  6. {
  7. /*
  8. 页大小,默认20,1~100
  9. 默认值:20 */
  10. private long? pageSize;
  11. /*
  12. 第几页,默认:1
  13. 默认值:1 */
  14. private long? pageNo;
  15. /*
  16. 官方提供的物料Id;可以通过taobao.tbk.optimus.tou.material.ids.get接口获取公开的物料id列表或查看物料id汇总贴:https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628875?_k=gpov9a
  17. */
  18. private long? materialId;
  19. /*
  20. 推广位id,mm_xxx_xxx_12345678三段式的最后一段数字(登录pub.alimama.com推广管理-推广位管理中查询)
  21. */
  22. private long? adzoneId;
  23. /*
  24. 渠道关系ID,仅适用于渠道推广场景
  25. */
  26. private long? relationId;
  27. /*
  28. 智能匹配-设备号类型:IMEI,或者IDFA,或者UTDID(UTDID不支持MD5加密),或者OAID;使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin
  29. */
  30. private string? deviceType;
  31. /*
  32. 智能匹配-设备号加密类型:MD5;使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin
  33. */
  34. private string? deviceEncrypt;
  35. /*
  36. 智能匹配-设备号加密后的值(MD5加密需32位小写);使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin
  37. */
  38. private string? deviceValue;
  39. /*
  40. 1-自购省,2-推广赚(代理模式专属ID,代理模式必填,非代理模式不用填写该字段)
  41. */
  42. private string? promotionType;
  43. /*
  44. 会员运营ID
  45. */
  46. private string? specialId;
  47. /*
  48. 淘宝客新商品ID;用于相似商品推荐(注意:使用相似商品推荐material_id=13256必传,并请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin);另关于《淘宝客新商品ID升级》参考白皮书:https://www.yuque.com/taobaolianmengguanfangxiaoer/zmig94/tfyt0pahmlpzu2ud
  49. */
  50. private string? itemId;
  51. /*
  52. 选品库收藏夹id,获取收藏夹id参考文档:https://mos.m.taobao.com/union/page_20230109_175050_176?spm=a219t._portal_v2_pages_promo_goods_index_htm.0.0.7c2a75a5H2ER3N
  53. */
  54. private string? favoritesId;
  55. [JsonPropertyName("page_size")]
  56. public long? PageSize
  57. {
  58. get => pageSize;
  59. set => this.pageSize = value;
  60. }
  61. [JsonPropertyName("page_no")]
  62. public long? PageNo
  63. {
  64. get => pageNo;
  65. set => this.pageNo = value;
  66. }
  67. [JsonPropertyName("material_id")]
  68. public long? MaterialId
  69. {
  70. get => materialId;
  71. set => this.materialId = value;
  72. }
  73. [JsonPropertyName("adzone_id")]
  74. public long? AdzoneId
  75. {
  76. get => adzoneId;
  77. set => this.adzoneId = value;
  78. }
  79. [JsonPropertyName("relation_id")]
  80. public long? RelationId
  81. {
  82. get => relationId;
  83. set => this.relationId = value;
  84. }
  85. [JsonPropertyName("device_type")]
  86. public string? DeviceType
  87. {
  88. get => deviceType;
  89. set => this.deviceType = value;
  90. }
  91. [JsonPropertyName("device_encrypt")]
  92. public string? DeviceEncrypt
  93. {
  94. get => deviceEncrypt;
  95. set => this.deviceEncrypt = value;
  96. }
  97. [JsonPropertyName("device_value")]
  98. public string? DeviceValue
  99. {
  100. get => deviceValue;
  101. set => this.deviceValue = value;
  102. }
  103. [JsonPropertyName("promotion_type")]
  104. public string? PromotionType
  105. {
  106. get => promotionType;
  107. set => this.promotionType = value;
  108. }
  109. [JsonPropertyName("special_id")]
  110. public string? SpecialId
  111. {
  112. get => specialId;
  113. set => this.specialId = value;
  114. }
  115. [JsonPropertyName("item_id")]
  116. public string? ItemId
  117. {
  118. get => itemId;
  119. set => this.itemId = value;
  120. }
  121. [JsonPropertyName("favorites_id")]
  122. public string? FavoritesId
  123. {
  124. get => favoritesId;
  125. set => this.favoritesId = value;
  126. }
  127. public override IDictionary<string, string> ToRequestParam()
  128. {
  129. IDictionary<string, string> requestParam = new Dictionary<string, string>();
  130. if(this.pageSize != null)
  131. {
  132. requestParam.Add("page_size",TopUtils.ConvertBasicType(this.pageSize));
  133. }
  134. if(this.pageNo != null)
  135. {
  136. requestParam.Add("page_no",TopUtils.ConvertBasicType(this.pageNo));
  137. }
  138. if(this.materialId != null)
  139. {
  140. requestParam.Add("material_id",TopUtils.ConvertBasicType(this.materialId));
  141. }
  142. if(this.adzoneId != null)
  143. {
  144. requestParam.Add("adzone_id",TopUtils.ConvertBasicType(this.adzoneId));
  145. }
  146. if(this.relationId != null)
  147. {
  148. requestParam.Add("relation_id",TopUtils.ConvertBasicType(this.relationId));
  149. }
  150. if(this.deviceType != null)
  151. {
  152. requestParam.Add("device_type",TopUtils.ConvertBasicType(this.deviceType));
  153. }
  154. if(this.deviceEncrypt != null)
  155. {
  156. requestParam.Add("device_encrypt",TopUtils.ConvertBasicType(this.deviceEncrypt));
  157. }
  158. if(this.deviceValue != null)
  159. {
  160. requestParam.Add("device_value",TopUtils.ConvertBasicType(this.deviceValue));
  161. }
  162. if(this.promotionType != null)
  163. {
  164. requestParam.Add("promotion_type",TopUtils.ConvertBasicType(this.promotionType));
  165. }
  166. if(this.specialId != null)
  167. {
  168. requestParam.Add("special_id",TopUtils.ConvertBasicType(this.specialId));
  169. }
  170. if(this.itemId != null)
  171. {
  172. requestParam.Add("item_id",TopUtils.ConvertBasicType(this.itemId));
  173. }
  174. if(this.favoritesId != null)
  175. {
  176. requestParam.Add("favorites_id",TopUtils.ConvertBasicType(this.favoritesId));
  177. }
  178. return requestParam;
  179. }
  180. public override IDictionary<string, TopFileItem> ToFileParam()
  181. {
  182. IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
  183. return fileParam;
  184. }
  185. public override string GetApiCode()
  186. {
  187. return "taobao.tbk.dg.material.recommend";
  188. }
  189. }