pawap90 / uade-movie-api Goto Github PK
View Code? Open in Web Editor NEWUADE | 2020 | Distribuidas | Movie backend API
UADE | 2020 | Distribuidas | Movie backend API
The endpoint will receive the body, extract the account id from the jwt, and insert everything on the rates
collection.
Route: api/rate
Method: POST
Requires authorization
Body:
The account id can be retrieved from the jwt.
Rate model:
Build authorization middleware that verifies the JWT from the Authorization header.
The endpoint will receive the media type and id through the route params, extract the account id from the jwt, get all rates for the specified media (movie or series) and set ratedByMe=true
on the rates that were created by the current user.
Route: api/rate/:mediaType/:mediaId
Method: GET
Requires authorization
The account id must be retrieved from the jwt.
Requires auth
Receives the current and new password.
If the current password is valid, updates the new password
When creating a new list, the "isDefault" property should be set to "false".
Endpoint: /api/account/register
Method: POST
Body: Receives email, name, lastName, password, genres (string array)
Inserts the account info into the account collection
The endpoint doesn't return any data
Note: The account model must be updated to store an array of genres
Also add the swagger documentation
Add swagger documentation
Returns the current user's lists.
The endpoint will extract the account id from the jwt and search the list
collection for lists that match the account id.
Route: api/list
Method: GET
Requires authorization
The account id can be retrieved from the jwt.
Removes a media item from the specified list (:listId).
The endpoint will receive the list id in the route params, extract the account id from the jwt, and remove the received media item from the specified list.
Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).
Route: api/list/:listId/item/:mediaType/:mediaId
Method: DELETE
Requires authorization
The account id can be retrieved from the jwt.
Adds a media item to the current user's default list.
The endpoint will receive the media item in the body, extract the account id from the jwt, and add the received media item to the current user's default list.
Route: api/list/item
Method: POST
Requires authorization
Body:
The account id can be retrieved from the jwt.
The endpoint will receive the list data on the body, extract the account id from the jwt and insert a new list with empty media items on the list
collection.
Route: api/list
Method: POST
Body:
Requires authorization
The account id must be retrieved from the jwt.
Also create the list
model:
- isDefault
- name
- accountId
- isPublic
- mediaItems: [
{
type
id,
title,
description,
imagePath,
genres (string array),
year
}
]
The endpoint will receive the list data on the body, the list id on the route params, extract the account id from the jwt and update the specified list's data.
Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).
Route: api/list/:listId
Method: PUT
Body:
Requires authorization
The account id must be retrieved from the jwt.
The endpoint will receive the list id on the route params, extract the account id from the jwt and delete the specified list.
Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).
Route: api/list/:listId
Method: DELETE
Requires authorization
The account id must be retrieved from the jwt.
The endpoint will allow the current user to update their account data.
Route: api/account
Method: PUT
Requires authorization
Body:
name, lastName, genres
The account id can be retrieved from the jwt.
Throw Confict (409) instead of BadRequest when the email already exists in the account collection
Enter email and password, authorize and get JWT
Adds a media item to the specified list (:listId).
The endpoint will receive the list id in the route params, the media item in the body, extract the account id from the jwt. Finally it will add the provided media item into the specified list id.
Note: Must validate that the current user owns the specified list (one user cannot modify another user's lists).
Route: api/list/:listId/item
Method: POST
Requires authorization
The account id can be retrieved from the jwt.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.