AntMerchantExpandIndirectImageUploadRequest.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using System;
  2. using System.Collections.Generic;
  3. using Aop.Api.Response;
  4. using Aop.Api.Util;
  5. namespace Aop.Api.Request
  6. {
  7. /// <summary>
  8. /// AOP API: ant.merchant.expand.indirect.image.upload
  9. /// </summary>
  10. public class AntMerchantExpandIndirectImageUploadRequest : IAopUploadRequest<AntMerchantExpandIndirectImageUploadResponse>
  11. {
  12. /// <summary>
  13. /// 图片二进制字节流,最大为10M
  14. /// </summary>
  15. public FileItem ImageContent { get; set; }
  16. /// <summary>
  17. /// 图片格式,支持格式:bmp、jpg、jpeg、png、gif.
  18. /// </summary>
  19. public string ImageType { get; set; }
  20. #region IAopRequest Members
  21. private bool needEncrypt=false;
  22. private string apiVersion = "1.0";
  23. private string terminalType;
  24. private string terminalInfo;
  25. private string prodCode;
  26. private string notifyUrl;
  27. private string returnUrl;
  28. private AopObject bizModel;
  29. private Dictionary<string, string> udfParams; //add user-defined text parameters
  30. public void SetNeedEncrypt(bool needEncrypt){
  31. this.needEncrypt=needEncrypt;
  32. }
  33. public bool GetNeedEncrypt(){
  34. return this.needEncrypt;
  35. }
  36. public void SetNotifyUrl(string notifyUrl){
  37. this.notifyUrl = notifyUrl;
  38. }
  39. public string GetNotifyUrl(){
  40. return this.notifyUrl;
  41. }
  42. public void SetReturnUrl(string returnUrl){
  43. this.returnUrl = returnUrl;
  44. }
  45. public string GetReturnUrl(){
  46. return this.returnUrl;
  47. }
  48. public void SetTerminalType(String terminalType){
  49. this.terminalType=terminalType;
  50. }
  51. public string GetTerminalType(){
  52. return this.terminalType;
  53. }
  54. public void SetTerminalInfo(String terminalInfo){
  55. this.terminalInfo=terminalInfo;
  56. }
  57. public string GetTerminalInfo(){
  58. return this.terminalInfo;
  59. }
  60. public void SetProdCode(String prodCode){
  61. this.prodCode=prodCode;
  62. }
  63. public string GetProdCode(){
  64. return this.prodCode;
  65. }
  66. public void SetApiVersion(string apiVersion){
  67. this.apiVersion=apiVersion;
  68. }
  69. public string GetApiVersion(){
  70. return this.apiVersion;
  71. }
  72. public string GetApiName()
  73. {
  74. return "ant.merchant.expand.indirect.image.upload";
  75. }
  76. public void PutOtherTextParam(string key, string value)
  77. {
  78. if(this.udfParams == null)
  79. {
  80. this.udfParams = new Dictionary<string, string>();
  81. }
  82. this.udfParams.Add(key, value);
  83. }
  84. public IDictionary<string, string> GetParameters()
  85. {
  86. AopDictionary parameters = new AopDictionary();
  87. parameters.Add("image_type", this.ImageType);
  88. if(udfParams != null)
  89. {
  90. parameters.AddAll(this.udfParams);
  91. }
  92. return parameters;
  93. }
  94. public AopObject GetBizModel()
  95. {
  96. return this.bizModel;
  97. }
  98. public void SetBizModel(AopObject bizModel)
  99. {
  100. this.bizModel = bizModel;
  101. }
  102. #endregion
  103. #region IAopUploadRequest Members
  104. public IDictionary<string, FileItem> GetFileParameters()
  105. {
  106. IDictionary<string, FileItem> parameters = new Dictionary<string, FileItem>();
  107. parameters.Add("image_content", this.ImageContent);
  108. return parameters;
  109. }
  110. #endregion
  111. }
  112. }