Skip to content

rossw01/GinMoviesList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MoviesListAPI

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.


Collection: User

End-point: RegisterUser

Registers a user.

POST Image

http://localhost:8080/register

Body(json)

{
    "username": "test2",
    "password": "test"
}

End-point: GetUserByID

Returns the user with corresponding user ID.

GET Image

http://localhost:8080/user/6

End-point: UpdateUser

Updates specified user's login details. (WIP).

PUT Image

http://localhost:8080/user/4

Body(json)

{
    "username": "test2",
    "password": "test"
}

End-point: DeleteUser

Deletes a user with the corresponding user ID.

DELETE Image

http://localhost:8080/user/3

End-point: LoginUser

Logs the user in.

If login attempt is successful, a cookie containing a JWT called "jwt" is returned in the response.

POST Image

http://localhost:8080/login

Body(json)

{
    "username": "test",
    "password": "test"
}

Collection: Review

End-point: CreateReview

Generates a review.

POST Image

http://localhost:8080/review

Body(json)

{
    "authorId": 2,
    "movieId": "19995",
    "rating": 2.5,
    "subject": "i love this film!!",
    "body": "FUNNY blue men!"
}

End-point: GetReviewsByMovieID

Returns all reviews with specified movie ID.

GET Image

http://localhost:8080/review/19995

End-point: DeleteReview

Deletes review with corresponding review ID.

DELETE Image

http://localhost:8080/review/5

End-point: UpdateReview

Updates review with corresponding review ID.

Custom middleware prevents user from editing reviews they didn't author.

PUT Image

http://localhost:8080/review/2

Body(json)

{
    "movieId": "19995",
    "rating": 4.0,
    "subject": "i LOVE this film!!",
    "body": "Funny blue men!"
}

End-point: GetAvgRatingByMovieID

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.

GET Image

http://localhost:8080/review/19995/rating

End-point: GetMoviesByAuthor

Returns a list of all of the reviews with corresponding username.

GET Image

http://localhost:8080/review/user/username

Created using PostmanMarkdownGenerator by Ross W.

About

Golang Movie Reviewing Platform API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages