TaobaoTopSecretGetRequest.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3. using Topsdk.Util;
  4. namespace Topsdk.Top.Ability304.Request;
  5. public class TaobaoTopSecretGetRequest : AbstractTopApiRequest
  6. {
  7. /*
  8. 秘钥版本号
  9. */
  10. private long? secretVersion;
  11. /*
  12. 伪随机数
  13. */
  14. private string? randomNum;
  15. /*
  16. 自定义用户id
  17. */
  18. private long? customerUserId;
  19. [JsonPropertyName("secret_version")]
  20. public long? SecretVersion
  21. {
  22. get => secretVersion;
  23. set => this.secretVersion = value;
  24. }
  25. [JsonPropertyName("random_num")]
  26. public string? RandomNum
  27. {
  28. get => randomNum;
  29. set => this.randomNum = value;
  30. }
  31. [JsonPropertyName("customer_user_id")]
  32. public long? CustomerUserId
  33. {
  34. get => customerUserId;
  35. set => this.customerUserId = value;
  36. }
  37. public override IDictionary<string, string> ToRequestParam()
  38. {
  39. IDictionary<string, string> requestParam = new Dictionary<string, string>();
  40. if(this.secretVersion != null)
  41. {
  42. requestParam.Add("secret_version",TopUtils.ConvertBasicType(this.secretVersion));
  43. }
  44. if(this.randomNum != null)
  45. {
  46. requestParam.Add("random_num",TopUtils.ConvertBasicType(this.randomNum));
  47. }
  48. if(this.customerUserId != null)
  49. {
  50. requestParam.Add("customer_user_id",TopUtils.ConvertBasicType(this.customerUserId));
  51. }
  52. return requestParam;
  53. }
  54. public override IDictionary<string, TopFileItem> ToFileParam()
  55. {
  56. IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
  57. return fileParam;
  58. }
  59. public override string GetApiCode()
  60. {
  61. return "taobao.top.secret.get";
  62. }
  63. }