Reference no: EM133710184
Homework: Computer Science
For this homework, you will need to create a Netbeans project (using Spring Initializer) which you will need to name using your Last name followed by your first name followed by "-Homework" to name it.
Finally you will need to perform this work using Spring Boot.
Part 1: Initialization
A. Our spring system will be a video game catalog system that will allow us to work with a video game database We'll need a basic video game object (name it Game) which has the following fields with the following types:
I. EQUALS method should exist and use GID to compare games for equality
II. Should include the following fields
a. GID (int), name (String), system (String) genre (String) price (double)
i. Note that system is the type of system the game runs on (Atari, Nintendo Swith, etc.)
ii. Note that genre is a type of game, like RPG, Action, Racing, etc
B. Your Controller should create 30 games at random using the initialization code similar to what we developed in class and store them in an ArrayList designed to store games.
Part 2: GET endpoint
A. Get all games
B. Get employee with given GID
I. GID must be given through the pat
II. If the employee with the given GID exists, return it
III. Otherwise, return 404
C. Get all games for a given system
I. System must be given through the pat
II. Return all games for a given system
D. Get all games for a given genre
I. Genre must be given through the pat
II. Return all games for a given genre
E. Get all games priced between a given range (low, high values
I. A high value and a low value must be given through the pat
II. Return all games that are priced between the high and low given val
Part 3: POST endpoint
A. Add a game
I. Game must be given through the body
II. No duplicates allowed
III. Only accept valid games (must use validation criteria from part V)
IV. Report with game if OK, or report FOUND
Part 4: PUT endpoint
A. Update a game
I. Game must be given through the body
II. Game must already exist
III. Update the game using the given game values
IV. Only accept valid games
V. Report with employee if OK, conflict otherwise
Part 5: DELETE endpoint
A. Delete game with the given GID
I. GID must be given through the pat
II. Game must exist with the given GI
III. Report with game if OK, 404 otherwise
Part 6: Validation (Employee)
A. Validate all fields of employee using the following constrain
I. GID must be present and a 6 digit number
II. Name, genre, system must be present and not empty string
III. Price must be positive number and greater than 0
IV. Make sure to have exception handling as necessary.
You will work on some additional GET endpoints
A. Create a new object named Manufacturer with two fields: (int MID, and (String) name
B. In the constructor for your controller, generate 5 manufactures and put them into a separate list.
C. Create an additional int field for game named man (will refer to their manufacturer's MID) and initialize the field during creation of the games to one of the MIDs of the manufacturers you created.
D. Create the endpoints necessary in the same controller to manage manufacturer (list, delete, update, put)
E. Create an endpoint that gets all games for a given manufacturer name
I. Manufacturer name must be given through the path.
II. Return all games for a given manufacturer name.