Ravi Srinivasan
2019-07-12 fe9006dcadfc00605f012d2bc5492132c436c50c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.redhat.movies;
 
import java.util.ArrayList;
import java.util.List;
import java.io.File;
 
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping("/")
public class MoviesController {
 
    private List<Movie> movies;
    private String status = "OK";
    private String flag = "READY";
 
    @GetMapping("/movies")
    public List<Movie> getAllMovies() {
 
        //Generate fake static data
        movies = new ArrayList<Movie>();
        movies.add(new Movie(1,"The Godfather","Crime/Thriller"));
        movies.add(new Movie(2,"Star Wars","Sci-Fi"));
        movies.add(new Movie(3,"The Mask","Comedy"));
        movies.add(new Movie(4,"Die Hard","Action"));
        movies.add(new Movie(5,"The Exorcist","Horror"));
        movies.add(new Movie(6,"The Silence of the Lambs","Drama"));
 
        return movies;
    }
 
    @GetMapping("/status")
    public String getStatus() {
        return status;
    }
 
}