The simple project for simulating the book selling/purchasing with REST API
Bank API has the following function scripts:
- (POST)/api/create_account -- variables: email, pwd
- (POST)/api/log_in -- variables: email, pwd
- (POST)/api/auth -- cookies: id, hash -- response: id, email
- (POST)/api/deposit -- cookies: id, hash; variables: ammount
- (POST)/api/transfer -- cookies: id, hash, variables: id, ammount
- (GET)/api/get_balance -- variables: id
- (POST)/api/create_account -- variables: email, pwd
- (POST)/api/log_in -- variables: email, pwd
- (POST)/api/auth -- cookies: id, hash -- response: id, email
- (POST)/api/add_book -- cookies: id, hash; variables: title, bank_id, price
- (POST)/api/buy_book -- cookies: id, hash; variables: book_id, bank_id, bank_pwd
- (GET)/api/list_books -- response: array of books(id, seller_id, seller_bank_id, price, title)
- (GET)/api/list_owned_books -- cookies: id, hash; response: array of books(id, seller_id, seller_bank_id, price, title)
- (GET)/api/book_info/:id -- response: seller_id, seller_bank_id, price, title