dreamworker

Untitled

Nov 28th, 2019
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.48 KB | None | 0 0
  1. $ java -jar client-0.1.jar
  2. Using client config: Server{hostName='localhost', port=8084}
  3.  
  4.  
  5. Список товаров:
  6.  
  7. REQUEST
  8. {"id":1000,"method":"shop.entities.product.getAll","params":null}
  9.  
  10. HTTP 200 OK
  11. {"id":1000,"result":[{"id":1,"created":1574998553,"updated":1574998553,"name":"Maharaj","vcode":"8207370","testDate":0},{"id":2,"created":1574998553,"updated":1574998553,"name":"Ruination IPA","vcode":"2906567","testDate":0},{"id":3,"created":1574998553,"updated":1574998553,"name":"Pliny The Elder","vcode":"5859349","testDate":0},{"id":4,"created":1574998553,"updated":1574998553,"name":"Hercules Double IPA","vcode":"3737168","testDate":0},{"id":5,"created":1574998553,"updated":1574998553,"name":"Trois Pistoles","vcode":"6632904","testDate":0}]}
  12.  
  13. [ProductDto{id=1, name='Maharaj', vcode='8207370', testDate=1970-01-01T00:00:00Z, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductDto{id=2, name='Ruination IPA', vcode='2906567', testDate=1970-01-01T00:00:00Z, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductDto{id=3, name='Pliny The Elder', vcode='5859349', testDate=1970-01-01T00:00:00Z, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductDto{id=4, name='Hercules Double IPA', vcode='3737168', testDate=1970-01-01T00:00:00Z, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductDto{id=5, name='Trois Pistoles', vcode='6632904', testDate=1970-01-01T00:00:00Z, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}]
  14.  
  15.  
  16. Запасы на складе:
  17.  
  18. REQUEST
  19. {"id":1000,"method":"shop.entities.storage.getAll","params":null}
  20.  
  21. HTTP 200 OK
  22. {"id":1000,"result":[{"id":1,"created":1574998553,"updated":1574998553,"productId":1,"count":9},{"id":2,"created":1574998553,"updated":1574998553,"productId":2,"count":49},{"id":3,"created":1574998553,"updated":1574998553,"productId":3,"count":36},{"id":4,"created":1574998553,"updated":1574998553,"productId":4,"count":47},{"id":5,"created":1574998553,"updated":1574998553,"productId":5,"count":26}]}
  23.  
  24. [ProductItemDto{id=1,productId=1, count=9, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductItemDto{id=2,productId=2, count=49, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductItemDto{id=3,productId=3, count=36, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductItemDto{id=4,productId=4, count=47, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}, ProductItemDto{id=5,productId=5, count=26, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:53Z}]
  25.  
  26.  
  27. Завезем на склад 500 единиц товара с id=2:
  28.  
  29. REQUEST
  30. {"id":1000,"method":"shop.entities.storage.put","params":{"id":null,"created":null,"updated":null,"productId":2,"count":500}}
  31.  
  32. HTTP 200 OK
  33. {"id":1000,"result":2}
  34.  
  35.  
  36.  
  37. Запасы товара id=2 на складе:
  38.  
  39. REQUEST
  40. {"id":1000,"method":"shop.entities.storage.getById","params":2}
  41.  
  42. HTTP 200 OK
  43. {"id":1000,"result":{"id":2,"created":1574998553,"updated":1574998559,"productId":2,"count":549}}
  44.  
  45. ProductItemDto{id=2,productId=2, count=549, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:59Z}
  46.  
  47.  
  48. Попытаемся забрать со склада 9999 единиц товара с id=2:
  49.  
  50. REQUEST
  51. {"id":1000,"method":"shop.entities.storage.remove","params":{"id":null,"created":null,"updated":null,"productId":2,"count":9999}}
  52.  
  53. HTTP 400 BAD_REQUEST
  54. {"id":1000,"error":{"message":"product doesn't exists/not enough amount in storage to remove","code":400}}
Advertisement
Add Comment
Please, Sign In to add comment