Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
A3 – Microservices
DESCRIPTION
You will be creating backend Java API using 2 microservices that will communicate with each
other to accomplish specific use-cases. You will be using MongoDB and Neo4J databases for the
two services, and will be implementing this assignment using the Java Spring framework.
REQUIREMENTS
Please implement the following REST API
Each REST API must return the OK status if the operation was successful, otherwise the
appropriate not-”OK” status must be returned (i.e. “INTERNAL_SERVER_ERROR” or
“NOT_FOUND”). Furthermore, all of the microservice routes will also return the path that was
called via the “path” property (you don’t have to modify this part of the code) for your
reference (we will not be checking this when marking).
Profile Microservice
Contains all Profile and Playlist information and routes. This service must run on port 3002
● POST /profile
○ Description: Adds a profile to the Profile database, creates userName-favorites
playlist and creates relation (nProfile:profile)-[:created]->(nPlaylist:playlist)
○ Body Parameters:
■ userName – The name of the Profile
■ fullName – The full name of the User of the profile
■ password- The password associated with the Profile
○ Expected Response:
■ “status”
● “OK”, if Profile is created and added correctly to the database
● <string>, any other status if the Profile was unable to be created
● PUT /followFriend/{userName}/{friendUserName}
○ Description: Allows a Profile to follow another Profile and become a friend
○ URL Parameters:
■ userName – The userName of the Profile that will follow another Profile
■ friendUserName – The userName of the Profile that will be followed
○ Expected Response:
■ “status”
● “OK”, if the user is able to follow the specified User
● <string>, any other status if the Profile was unable to follow the
specified Profile
● PUT /unfollowFriend/{userName}/{friendUserName}
○ Description: Allows a Profile to unfollow another Profile and no longer be “friends”
with them
○ URL Parameters:
■ userName – The userName of the Profile that will unfollow another Profile
■ friendUserName – The userName of the Profile that is being unfollowed
○ Expected Response:
■ “status”
● “OK”, if the user is able to unfollow the specified User
● <string>, any other status if the Profile was not able to unfollow the
specified Profile
● PUT /likeSong/{userName}/{songId}
○ Description: Allows a Profile to like a song and add it to their favourites. You can
like the same song twice.
○ URL Parameters:
■ userName – The userName of the Profile that is going to like the song (i.e.
add the song to their favourites)
■ songId – a String that represents the _id of the song that needs to be liked
○ Expected Response:
■ “status”
● “OK”, if the User is able to like the Song
● <string>, any other status if the Profile was not able to like the
specified Song