It represents an application service with REST API using Hibernate/SpringMVC. Other technologies used: hsqlbd, maven, git
###Admin:
Main functions:
####input new restaurant
curl -s -X POST -H "Content-Type:application/json;charset=UTF-8" -d {\"name\":\"created\"} http://localhost:8050/rest/admin/restaurants --user admin@gmail.com:admin
####input new meal into today menu for restaurant with id = 100002
curl -X POST http://localhost:8050/rest/admin/meals -H 'content-type: application/json' -d '{"name":"new meal","price":100,"restaurant":{"id":100002}}' --user admin@gmail.com:admin
Additional functions:
####update restaurant
curl -s -X PUT -d {\"name\":\"updated\"} -H "Content-Type:application/json;charset=UTF-8" http://localhost:8050/rest/admin/restaurants/100002 --user admin@gmail.com:admin
####delete restaurant
curl -s -X DELETE http://localhost:8050/rest/admin/restaurants/100002 --user admin@gmail.com:admin
####get meal with id=100005
curl -s http://localhost:8050/rest/admin/meals/100005 --user admin@gmail.com:admin
####update meal with id=100005
curl -X PUT http://localhost:8050/rest/admin/meals/100005 -H 'content-type: application/json' -d '{"id": 100005,"name": "Updated","price": 900,"date": "2020-05-10","restaurant":{"id":100002}}' --user admin@gmail.com:admin
####delete meal with id=100005
curl -s -X DELETE http://localhost:8050/rest/admin/meals/100005 --user admin@gmail.com:admin
curl -s http://localhost:8050/rest/admin/users --user admin@gmail.com:admin
curl -s http://localhost:8050/rest/admin/users/100001 --user admin@gmail.com:admin
Main functions:
###place a vote for restaurant with id = 100004
curl -X POST http://localhost:8050/rest/profile/votes/100004 --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/restaurants/votes --user user@yandex.ru:password
###get today votes for restaurant with id = 100003
curl -s http://localhost:8050/rest/profile/votes/100003 --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/restaurants/menus --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/menu/100002 --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/menu/100002/history --user user@yandex.ru:password
###get votes history for authorised user
curl -s http://localhost:8050/rest/profile/votes/history --user user@yandex.ru:password
Additional functions:
###delete today vote
curl -X DELETE http://localhost:8050/rest/profile/votes --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/votes --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/restaurants --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/restaurants/100004 --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/restaurants/100004/votes --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile/restaurants/100004/menu --user user@yandex.ru:password
curl -s http://localhost:8050/rest/profile --user user@yandex.ru:password
###Not auth user - not working
curl -s -i -X POST -d '{"name":"New User","email":"test@mail.ru","password":"test-password"}' -H 'Content-Type:application/json;charset=UTF-8' http://localhost:8050/rest/profile/register