rahul.raghuvanshi.42
BAN USERYou can divide each use case into micro-services. lets Say:
/search?query //give search result in json format
/restaurant_name //gives detail for particular restaurant in json format
| //reqeust followed by restaurant_name/changemenu
--> PUT for /restaurant_name/changemenu
--> DELETE for /resaurant_name/deletemenu
order/user
|
-->POST for order/user/addItem
-->POST for order/user/addItems
-->DELETE for order/user/deleteItem
-->DELETE for order/user/deleteItems
-->POST or DELETE for order/user/cancelorder
-->GET for order/user/tracklocation
/pay -->POST for /pay redirect to payment gateway
Here i assumed broadly five tables User(u_name, address), Restaurant(r_name, menu),
Order(o_id, u_name, items, total, status), Location(o_id, location_detail)
UI will use these REST endpoint to perform a specific task. For example /search?query to search a restaurant. At server side this /search endpoint calls the database table Restaurant to search for particular restaurant and return all restaurant matching query criteria in json format.
Similarly for other use cases also this REST based micro-service architecture will be use.
- rahul.raghuvanshi.42 April 02, 2017