api-auto-test.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. {
  2. "info": {
  3. "_postman_id": "5b90b987-503f-484c-b8d7-a0974674e95d",
  4. "name": "api-auto-test",
  5. "description": "Auto API 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. "item": [
  13. {
  14. "name": "登录",
  15. "event": [
  16. {
  17. "listen": "test",
  18. "script": {
  19. "exec": [
  20. "var result = pm.response.json();",
  21. "pm.environment.set(\"api-login-id\", result.LoginId);"
  22. ],
  23. "type": "text/javascript",
  24. "packages": {},
  25. "requests": {}
  26. }
  27. }
  28. ],
  29. "request": {
  30. "auth": {
  31. "type": "noauth"
  32. },
  33. "method": "POST",
  34. "header": [
  35. {
  36. "key": "LanguageId",
  37. "value": "{{api-language}}",
  38. "description": "客户端语言别,0:简体 1:繁体 2:英文"
  39. },
  40. {
  41. "key": "Authorization",
  42. "value": "{{api-authorization}}",
  43. "description": "\"Basic MTBYWF8wMTo=\" 为\"10XX_01:\"的BASE64加密字符串,如在POSTMAN中的Authorization部分选择Basic Auth填入用户名+密码则不需在此传值"
  44. },
  45. {
  46. "key": "ClientType",
  47. "value": "{{api-client-type}}",
  48. "description": "用户自定义的客户端识别号,比如客户是WMS系统,可以自定义ClientType=“WMS”"
  49. },
  50. {
  51. "key": "Content-Type",
  52. "value": "{{api-content-type}}"
  53. },
  54. {
  55. "key": "X-Tiansi-Auth-Bypass",
  56. "value": "{{api-x-tiansi-bypass}}",
  57. "description": "跳过接口注册检验",
  58. "type": "text"
  59. },
  60. {
  61. "key": "sn",
  62. "value": "{{api-sn}}",
  63. "type": "text"
  64. }
  65. ],
  66. "url": {
  67. "raw": "{{api-url}}/User/login",
  68. "host": [
  69. "{{api-url}}"
  70. ],
  71. "path": [
  72. "User",
  73. "login"
  74. ]
  75. },
  76. "description": "用户登录"
  77. },
  78. "response": []
  79. }
  80. ],
  81. "description": "登录"
  82. },
  83. {
  84. "name": "货品资料",
  85. "item": [
  86. {
  87. "name": "新增货品",
  88. "request": {
  89. "method": "POST",
  90. "header": [
  91. {
  92. "key": "LoginId",
  93. "value": "{{api-login-id}}",
  94. "type": "text"
  95. },
  96. {
  97. "key": "sn",
  98. "value": "{{api-sn}}",
  99. "type": "text"
  100. }
  101. ],
  102. "body": {
  103. "mode": "raw",
  104. "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]",
  105. "options": {
  106. "raw": {
  107. "language": "json"
  108. }
  109. }
  110. },
  111. "url": {
  112. "raw": "{{api-url}}/Prdt/AppendToPrdt",
  113. "host": [
  114. "{{api-url}}"
  115. ],
  116. "path": [
  117. "Prdt",
  118. "AppendToPrdt"
  119. ]
  120. },
  121. "description": "新增货品"
  122. },
  123. "response": []
  124. },
  125. {
  126. "name": "删除货品",
  127. "request": {
  128. "method": "POST",
  129. "header": [
  130. {
  131. "key": "LoginId",
  132. "value": "{{api-login-id}}",
  133. "type": "text"
  134. },
  135. {
  136. "key": "sn",
  137. "value": "{{api-sn}}",
  138. "type": "text"
  139. }
  140. ],
  141. "body": {
  142. "mode": "raw",
  143. "raw": "[\r\n {\r\n \"PRD_NO\": \"HP00001\" // 必须,货品代号,删除该笔货品资料\r\n }\r\n]",
  144. "options": {
  145. "raw": {
  146. "language": "json"
  147. }
  148. }
  149. },
  150. "url": {
  151. "raw": "{{api-url}}/Prdt/DeleteForPrdt",
  152. "host": [
  153. "{{api-url}}"
  154. ],
  155. "path": [
  156. "Prdt",
  157. "DeleteForPrdt"
  158. ]
  159. },
  160. "description": "删除货品资料"
  161. },
  162. "response": []
  163. }
  164. ],
  165. "description": "货品资料"
  166. },
  167. {
  168. "name": "客户厂商资料",
  169. "item": [
  170. {
  171. "name": "新增客户厂商",
  172. "request": {
  173. "method": "POST",
  174. "header": [
  175. {
  176. "key": "LoginId",
  177. "value": "{{api-login-id}}",
  178. "type": "text"
  179. },
  180. {
  181. "key": "sn",
  182. "value": "{{api-sn}}",
  183. "type": "text"
  184. }
  185. ],
  186. "body": {
  187. "mode": "raw",
  188. "raw": "[\r\n {\r\n \"CUS_NO\": \"KH00001\", // 必须,客户厂商代号,该客户厂商代号在资料中存在即为修改原数据,不存在为新增\r\n \"OBJ_ID\": \"1\", // 必须,对象别,1:客户,2:厂商,3 :客户厂商;为空时默认取3\r\n \"NAME\": \"客户00001\", // 必须,全称\r\n \"SNM\": \"KH00001\", // 非必须,简称\r\n \"REM\": \"这是客户00001备注\" // 非必须,备注\r\n }\r\n]",
  189. "options": {
  190. "raw": {
  191. "language": "json"
  192. }
  193. }
  194. },
  195. "url": {
  196. "raw": "{{api-url}}/Cust/AppendToCust",
  197. "host": [
  198. "{{api-url}}"
  199. ],
  200. "path": [
  201. "Cust",
  202. "AppendToCust"
  203. ]
  204. },
  205. "description": "新增客户厂商资料"
  206. },
  207. "response": []
  208. },
  209. {
  210. "name": "删除客户厂商资料",
  211. "request": {
  212. "method": "POST",
  213. "header": [
  214. {
  215. "key": "LoginId",
  216. "value": "{{api-login-id}}",
  217. "type": "text"
  218. },
  219. {
  220. "key": "sn",
  221. "value": "{{api-sn}}",
  222. "type": "text"
  223. }
  224. ],
  225. "body": {
  226. "mode": "raw",
  227. "raw": "[\r\n {\r\n \"CUS_NO\": \"KH00001\" // 必须,客户厂商代号,删除该笔客户厂商资料\r\n }\r\n]",
  228. "options": {
  229. "raw": {
  230. "language": "json"
  231. }
  232. }
  233. },
  234. "url": {
  235. "raw": "{{api-url}}/Cust/DeleteForCust",
  236. "host": [
  237. "{{api-url}}"
  238. ],
  239. "path": [
  240. "Cust",
  241. "DeleteForCust"
  242. ]
  243. },
  244. "description": "删除客户厂商资料"
  245. },
  246. "response": []
  247. }
  248. ],
  249. "description": "客户/厂商资料"
  250. }
  251. ],
  252. "event": [
  253. {
  254. "listen": "prerequest",
  255. "script": {
  256. "type": "text/javascript",
  257. "packages": {},
  258. "requests": {},
  259. "exec": [
  260. ""
  261. ]
  262. }
  263. },
  264. {
  265. "listen": "test",
  266. "script": {
  267. "type": "text/javascript",
  268. "packages": {},
  269. "requests": {},
  270. "exec": [
  271. ""
  272. ]
  273. }
  274. }
  275. ]
  276. }