Untitled

 avatar
unknown
plain_text
a month ago
2.8 kB
4
Indexable
Day 15: Tasks: • Create a Spring Boot project for the Movie Booking Application. • Create a folder named controller inside com.examly.springapp. • Inside the controller folder, create a class named TestController. • Implement an HTTP GET request: o Endpoint: /api/test/welcome o Returns a String "Welcome to the Movie Booking Application". Day 16: Tasks: • Create a folder named entity inside com.examly.springapp. • Inside the entity folder, create a class named Movie with the following attributes: o movieId- Long o title - String o duration - int o genre- String o price- int • Implement getters, setters, a default constructor, and a parameterized constructor for the Movie class. Inside the TestController folder, Implement the GET Endpoint: • GET - "api/test/movie" - Returns a List<Movie> object. Create Movie objects with predefined values and return them as a list. Day 17: Overview: In this Movie Booking Application, various movies are available for users to book tickets for. Each movie has specific attributes such as title, duration, and available seats. Users can view these movies and book their tickets based on the available seats. There are two types of users for this application: • ADMIN • USER Functionalities: 1. Admin: o Create, update, and delete movies. o Modify movie details such as title, duration, available seats, etc. 2. User: o View all available movies. o Book a movie ticket. Tasks: 1. In the Movie class, use the @Entity annotation to define the representation of the Movie object to the database and configure the movieId attribute as the primary key with an autogenerated value. 2. Create a folder named repository and service inside com.examly.springapp. 3. Inside the repository folder, create an interface named MovieRepo and annotate it with @Repository. This interface should extend JpaRepository<Movie, Long>. 4. Inside the service folder, create an interface named MovieService and include abstract methods to implement CRUD operations for the Movie entity. 5. Inside the service folder, create a folder named serviceImpl. 6. Inside the serviceImpl folder, create a class MovieServiceImpl which implements the MovieService interface. This class should be annotated with @Service and provide implementations for the abstract methods defined in the interface. 7. Inside the controller folder, create a class MovieController and annotate it with @RestController to handle the following API endpoints: POST - api/movie - Adds a new movie to the system and returns the Movie object on successful insertion. PUT - api/movie/{movieId} - Updates movie details. All fields are modifiable except for the movieId field. Returns the updated Movie object on successful updation. this is daily assignment write only that which is asked for .This is spring boot projext so code in that manner only
Leave a Comment