additions
This commit is contained in:
@@ -4,24 +4,22 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import ru.ip.example.domain.AddSeazonDto;
|
||||
import ru.ip.example.domain.FilmDto;
|
||||
import ru.ip.example.service.FilmService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "FilmsController")
|
||||
public class FilmController {
|
||||
|
||||
private final FilmService filmService;
|
||||
|
||||
@Autowired
|
||||
public FilmController(FilmService filmService) {
|
||||
this.filmService = filmService;
|
||||
}
|
||||
|
||||
@GetMapping("/films")
|
||||
@Operation(description = "Возвращает список всех фильмов")
|
||||
public List<FilmDto> getAll() {
|
||||
@@ -51,4 +49,9 @@ public class FilmController {
|
||||
public void deleteById(@PathVariable("id") Integer id) {
|
||||
filmService.deleteById(id);
|
||||
}
|
||||
|
||||
@PutMapping("/films/seazons")
|
||||
public FilmDto addSeazon(@RequestBody AddSeazonDto addSeazonDto) {
|
||||
return filmService.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user