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":1575003235,"updated":1575003235,"name":"Westmalle Trappist Tripel","vcode":"1142311","testDate":0},{"id":2,"created":1575003235,"updated":1575003235,"name":"Trappistes Rochefort 8","vcode":"5858830","testDate":0},{"id":3,"created":1575003235,"updated":1575003235,"name":"Pliny The Elder","vcode":"1570175","testDate":0},{"id":4,"created":1575003235,"updated":1575003235,"name":"Maharaj","vcode":"4807385","testDate":0},{"id":5,"created":1575003235,"updated":1575003235,"name":"Sierra Nevada Bigfoot Barleywine Style Ale","vcode":"4855284","testDate":0}]}
- [ProductDto{id=1, name='Westmalle Trappist Tripel', vcode='1142311', testDate=1970-01-01T00:00:00Z, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductDto{id=2, name='Trappistes Rochefort 8', vcode='5858830', testDate=1970-01-01T00:00:00Z, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductDto{id=3, name='Pliny The Elder', vcode='1570175', testDate=1970-01-01T00:00:00Z, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductDto{id=4, name='Maharaj', vcode='4807385', testDate=1970-01-01T00:00:00Z, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductDto{id=5, name='Sierra Nevada Bigfoot Barleywine Style Ale', vcode='4855284', testDate=1970-01-01T00:00:00Z, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}]
- Запасы на складе:
- REQUEST
- {"id":1000,"method":"shop.entities.storage.getAll","params":null}
- HTTP 200 OK
- {"id":1000,"result":[{"id":1,"created":1575003235,"updated":1575003235,"productId":1,"count":8},{"id":2,"created":1575003235,"updated":1575003235,"productId":2,"count":502},{"id":3,"created":1575003235,"updated":1575003235,"productId":3,"count":18},{"id":4,"created":1575003235,"updated":1575003235,"productId":4,"count":48},{"id":5,"created":1575003235,"updated":1575003235,"productId":5,"count":35}]}
- [ProductItemDto{id=1,productId=1, count=8, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductItemDto{id=2,productId=2, count=502, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductItemDto{id=3,productId=3, count=18, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductItemDto{id=4,productId=4, count=48, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}, ProductItemDto{id=5,productId=5, count=35, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:53:55Z}]
- Завезем на склад 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":1575003235,"updated":1575003274,"productId":2,"count":1002}}
- ProductItemDto{id=2,productId=2, count=1002, created=2019-11-29T04:53:55Z, updated=2019-11-29T04:54:34Z}
- Попытаемся забрать со склада 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}}
- Сделаем заказ:
- REQUEST
- {"id":1000,"method":"shop.entities.order.put","params":{"id":null,"created":null,"updated":null,"itemList":[{"id":null,"created":null,"updated":null,"productId":3,"count":10}],"client":null,"manager":null}}
- HTTP 200 OK
- {"id":1000,"result":2}
- orderId: 2
- Проверим заказ:
- REQUEST
- {"id":1000,"method":"shop.entities.order.getById","params":2}
- HTTP 200 OK
- {"id":1000,"result":{"id":2,"created":1575003274,"updated":1575003274,"itemList":[{"id":2,"created":1575003274,"updated":1575003274,"productId":3,"count":10}],"client":null,"manager":null}}
- OrderDto{id=2, client=null, manager=null, created=2019-11-29T04:54:34Z, updated=2019-11-29T04:54:34Z, itemList=[OrderItemDto{id=2}]}
Advertisement
Add Comment
Please, Sign In to add comment