Request.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. package info.aspirecn.iov.sjjh.supplier10000034.gjwl;
  20. import java.util.List;
  21. import java.util.Map;
  22. import info.aspirecn.iov.sjjh.supplier10000034.gjwl.enums.Method;
  23. /**
  24. * Request
  25. */
  26. public class Request {
  27. public Request() {
  28. }
  29. public Request(Method method, String host, String path, String appKey, String appSecret, int timeout) {
  30. this.method = method;
  31. this.host = host;
  32. this.path = path;
  33. this.appKey = appKey;
  34. this.appSecret = appSecret;
  35. this.timeout = timeout;
  36. }
  37. /**
  38. * (必选)请求方法
  39. */
  40. private Method method;
  41. /**
  42. * (必选)Host
  43. */
  44. private String host;
  45. /**
  46. * (必选)Path
  47. */
  48. private String path;
  49. /**
  50. * (必选)APP KEY
  51. */
  52. private String appKey;
  53. /**
  54. * (必选)APP密钥
  55. */
  56. private String appSecret;
  57. /**
  58. * (必选)超时时间,单位毫秒,设置零默认使用com.aliyun.apigateway.demo.constant.Constants.DEFAULT_TIMEOUT
  59. */
  60. private int timeout;
  61. /**
  62. * (可选) HTTP头
  63. */
  64. private Map<String, String> headers;
  65. /**
  66. * (可选) Querys
  67. */
  68. private Map<String, String> querys;
  69. /**
  70. * (可选)表单参数
  71. */
  72. private Map<String, String> bodys;
  73. /**
  74. * (可选)字符串Body体
  75. */
  76. private String stringBody;
  77. /**
  78. * (可选)字节数组类型Body体
  79. */
  80. private byte[] bytesBody;
  81. /**
  82. * (可选)自定义参与签名Header前缀
  83. */
  84. private List<String> signHeaderPrefixList;
  85. public Method getMethod() {
  86. return method;
  87. }
  88. public void setMethod(Method method) {
  89. this.method = method;
  90. }
  91. public String getHost() {
  92. return host;
  93. }
  94. public void setPath(String path) {
  95. this.path = path;
  96. }
  97. public String getPath() {
  98. return path;
  99. }
  100. public void setHost(String host) {
  101. this.host = host;
  102. }
  103. public String getAppKey() {
  104. return appKey;
  105. }
  106. public void setAppKey(String appKey) {
  107. this.appKey = appKey;
  108. }
  109. public String getAppSecret() {
  110. return appSecret;
  111. }
  112. public void setAppSecret(String appSecret) {
  113. this.appSecret = appSecret;
  114. }
  115. public int getTimeout() {
  116. return timeout;
  117. }
  118. public void setTimeout(int timeout) {
  119. this.timeout = timeout;
  120. }
  121. public Map<String, String> getHeaders() {
  122. return headers;
  123. }
  124. public void setHeaders(Map<String, String> headers) {
  125. this.headers = headers;
  126. }
  127. public Map<String, String> getQuerys() {
  128. return querys;
  129. }
  130. public void setQuerys(Map<String, String> querys) {
  131. this.querys = querys;
  132. }
  133. public Map<String, String> getBodys() {
  134. return bodys;
  135. }
  136. public void setBodys(Map<String, String> bodys) {
  137. this.bodys = bodys;
  138. }
  139. public String getStringBody() {
  140. return stringBody;
  141. }
  142. public void setStringBody(String stringBody) {
  143. this.stringBody = stringBody;
  144. }
  145. public byte[] getBytesBody() {
  146. return bytesBody;
  147. }
  148. public void setBytesBody(byte[] bytesBody) {
  149. this.bytesBody = bytesBody;
  150. }
  151. public List<String> getSignHeaderPrefixList() {
  152. return signHeaderPrefixList;
  153. }
  154. public void setSignHeaderPrefixList(List<String> signHeaderPrefixList) {
  155. this.signHeaderPrefixList = signHeaderPrefixList;
  156. }
  157. }