Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ java -jar client-0.1.jar
- Using client config: Server{hostName='localhost', port=8084}
- Список товаров:
- REQUEST
- {"id":1000,"method":"shop.entities.product.getAll","params":null}
- HTTP 200 OK
- {"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}]}
- [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}]
- Запасы на складе:
- REQUEST
- {"id":1000,"method":"shop.entities.storage.getAll","params":null}
- HTTP 200 OK
- {"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}]}
- [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}]
- Завезем на склад 500 единиц товара с id=2:
- REQUEST
- {"id":1000,"method":"shop.entities.storage.put","params":{"id":null,"created":null,"updated":null,"productId":2,"count":500}}
- HTTP 200 OK
- {"id":1000,"result":2}
- Запасы товара id=2 на складе:
- REQUEST
- {"id":1000,"method":"shop.entities.storage.getById","params":2}
- HTTP 200 OK
- {"id":1000,"result":{"id":2,"created":1574998553,"updated":1574998559,"productId":2,"count":549}}
- ProductItemDto{id=2,productId=2, count=549, created=2019-11-29T03:35:53Z, updated=2019-11-29T03:35:59Z}
- Попытаемся забрать со склада 9999 единиц товара с id=2:
- REQUEST
- {"id":1000,"method":"shop.entities.storage.remove","params":{"id":null,"created":null,"updated":null,"productId":2,"count":9999}}
- HTTP 400 BAD_REQUEST
- {"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