api-tests-basic.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {
  2. "info": {
  3. "_postman_id": "5b90b987-503f-484c-b8d7-a0974674e95d",
  4. "name": "api-tests-basic",
  5. "description": "Auto test for Jenkins",
  6. "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
  7. "_exporter_id": "3170378"
  8. },
  9. "item": [
  10. {
  11. "name": "登录",
  12. "event": [
  13. {
  14. "listen": "test",
  15. "script": {
  16. "exec": [
  17. "var result = pm.response.json();",
  18. "pm.environment.set(\"api-login-id\", result.LoginId);"
  19. ],
  20. "type": "text/javascript",
  21. "packages": {},
  22. "requests": {}
  23. }
  24. }
  25. ],
  26. "request": {
  27. "auth": {
  28. "type": "noauth"
  29. },
  30. "method": "POST",
  31. "header": [
  32. {
  33. "key": "LanguageId",
  34. "value": "{{api-language}}",
  35. "description": "客户端语言别,0:简体 1:繁体 2:英文"
  36. },
  37. {
  38. "key": "Authorization",
  39. "value": "{{api-authorization}}",
  40. "description": "\"Basic MTBYWF8wMTo=\" 为\"10XX_01:\"的BASE64加密字符串,如在POSTMAN中的Authorization部分选择Basic Auth填入用户名+密码则不需在此传值"
  41. },
  42. {
  43. "key": "ClientType",
  44. "value": "{{api-client-type}}",
  45. "description": "用户自定义的客户端识别号,比如客户是WMS系统,可以自定义ClientType=“WMS”"
  46. },
  47. {
  48. "key": "Content-Type",
  49. "value": "{{api-content-type}}"
  50. },
  51. {
  52. "key": "X-Tiansi-Auth-Bypass",
  53. "value": "{{api-x-tiansi-bypass}}",
  54. "description": "跳过接口注册检验",
  55. "type": "text"
  56. },
  57. {
  58. "key": "sn",
  59. "value": "{{api-sn}}",
  60. "type": "text"
  61. }
  62. ],
  63. "url": {
  64. "raw": "{{api-url}}/User/login",
  65. "host": [
  66. "{{api-url}}"
  67. ],
  68. "path": [
  69. "User",
  70. "login"
  71. ]
  72. },
  73. "description": "用户登录"
  74. },
  75. "response": []
  76. },
  77. {
  78. "name": "新增货品",
  79. "request": {
  80. "method": "POST",
  81. "header": [
  82. {
  83. "key": "LoginId",
  84. "value": "{{api-login-id}}",
  85. "type": "text"
  86. },
  87. {
  88. "key": "sn",
  89. "value": "{{api-sn}}",
  90. "type": "text"
  91. }
  92. ],
  93. "body": {
  94. "mode": "raw",
  95. "raw": "[\r\n {\r\n \"PRD_NO\": \"HP00001\", // 必须,货品代号,该货品代号在资料中存在即为修改原数据,不存在为新增\r\n \"NAME\": \"货品HP00001\", // 必须,货品名称\r\n \"UT\": \"KG\", // 必须,主单位\r\n \"SNM\": \"HP00001\", // 非必须,简称\r\n \"REM\": \"货品HP00001摘要,API测试\" // 非必须,摘要\r\n }\r\n]",
  96. "options": {
  97. "raw": {
  98. "language": "json"
  99. }
  100. }
  101. },
  102. "url": {
  103. "raw": "{{api-url}}/Prdt/AppendToPrdt",
  104. "host": [
  105. "{{api-url}}"
  106. ],
  107. "path": [
  108. "Prdt",
  109. "AppendToPrdt"
  110. ]
  111. },
  112. "description": "新增货品"
  113. },
  114. "response": []
  115. },
  116. {
  117. "name": "删除货品",
  118. "request": {
  119. "method": "POST",
  120. "header": [
  121. {
  122. "key": "LoginId",
  123. "value": "{{api-login-id}}",
  124. "type": "text"
  125. },
  126. {
  127. "key": "sn",
  128. "value": "{{api-sn}}",
  129. "type": "text"
  130. }
  131. ],
  132. "body": {
  133. "mode": "raw",
  134. "raw": "[\r\n {\r\n \"PRD_NO\": \"HP00001\" // 必须,货品代号,删除该笔货品资料\r\n }\r\n]",
  135. "options": {
  136. "raw": {
  137. "language": "json"
  138. }
  139. }
  140. },
  141. "url": {
  142. "raw": "{{api-url}}/Prdt/DeleteForPrdt",
  143. "host": [
  144. "{{api-url}}"
  145. ],
  146. "path": [
  147. "Prdt",
  148. "DeleteForPrdt"
  149. ]
  150. },
  151. "description": "删除货品"
  152. },
  153. "response": []
  154. }
  155. ],
  156. "event": [
  157. {
  158. "listen": "prerequest",
  159. "script": {
  160. "type": "text/javascript",
  161. "packages": {},
  162. "requests": {},
  163. "exec": [
  164. ""
  165. ]
  166. }
  167. },
  168. {
  169. "listen": "test",
  170. "script": {
  171. "type": "text/javascript",
  172. "packages": {},
  173. "requests": {},
  174. "exec": [
  175. ""
  176. ]
  177. }
  178. }
  179. ]
  180. }