Go + Gin + Gorm Backend API for handling user registration/login (using JWT for auth) and Review CRUD functions.
Movie IDs that correspond to those found in The Movie Database's API.
Registers a user.
http://localhost:8080/register
{
"username": "test2",
"password": "test"
}
Returns the user with corresponding user ID.
http://localhost:8080/user/6
Updates specified user's login details. (WIP).
http://localhost:8080/user/4
{
"username": "test2",
"password": "test"
}
Deletes a user with the corresponding user ID.
http://localhost:8080/user/3
Logs the user in.
If login attempt is successful, a cookie containing a JWT called "jwt" is returned in the response.
http://localhost:8080/login
{
"username": "test",
"password": "test"
}
Generates a review.
http://localhost:8080/review
{
"authorId": 2,
"movieId": "19995",
"rating": 2.5,
"subject": "i love this film!!",
"body": "FUNNY blue men!"
}
Returns all reviews with specified movie ID.
http://localhost:8080/review/19995
Deletes review with corresponding review ID.
http://localhost:8080/review/5
Updates review with corresponding review ID.
Custom middleware prevents user from editing reviews they didn't author.
http://localhost:8080/review/2
{
"movieId": "19995",
"rating": 4.0,
"subject": "i LOVE this film!!",
"body": "Funny blue men!"
}
Returns the average rating of reviews containing specified Movie ID as a float.
-1 is returned if no reviews have been created with the specified Movie ID.
http://localhost:8080/review/19995/rating
Returns a list of all of the reviews with corresponding username.
http://localhost:8080/review/user/username