POST request
http://localhost:8765/login
body : {
"id":"",
"username":"",
"password":""
}
userLogout
DELETE request
http://localhost:8765/logout
User Controller:-
To access most of user controller api's you have to provide the jwt token you recieve as a response while logging in inside the authorization header with the http request.
headers:{
'Authorization':'Bearer {JWTtoken}'
}
searchProductByName-
GET request
http://localhost:8765/search?name={name}
searchProductsByCategoryName-
GET request
http://localhost:8765/search/category?categoryName={categoryName}
addRatings-
PUT request
http://localhost:8765/add-rating?productId={productId}&rating={rating between 1-5}
getProductDetails-
GET request
http://localhost:8765/searchById?productId={productId}
addProductToCart-
POST request
http://localhost:8765/add-cart?productId={productId}&quantity={quantity}
PUT request
http://localhost:8765/update-username?username={newUsername}
updatePassword
PUT request
http://localhost:8765/update-password?password={newPassword}
Admin controller:-
All the api's for this controller are secured and can only be accessed by an admin, so if you are registred to the application as an admin than you just have to login and pass the jwt toke in the http request header as authorization.