From 4246c98078b7cc513045b994ca32a2074f6c446d Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Tue, 23 May 2023 19:52:23 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=A05=20=D0=BD=D0=B0=D0=B4=D0=BE=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE-=D1=82=D0=BE=20=D1=80=D0=B5=D1=88=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D1=81=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=D0=BC=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data.mv.db | Bin 69632 -> 90112 bytes .../controller/CollectionMvcController.java | 36 ++++++++++++------ .../controller/GenreMvcController.java | 2 +- .../DataBase/service/CollectionService.java | 11 ++++++ src/main/resources/templates/add-film.html | 28 ++++++++++++++ src/main/resources/templates/collection.html | 6 +++ src/main/resources/templates/view-films.html | 28 ++++++++++++++ 7 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/templates/add-film.html create mode 100644 src/main/resources/templates/view-films.html diff --git a/data.mv.db b/data.mv.db index 94f20c80ae53778f8accbef2d44301b3d9cdf4fd..047e6f692a8242ea9b6a1ce1c214f48c8dc62101 100644 GIT binary patch literal 90112 zcmeHwYm6Pom0tJE+?ggtQsPUb_^>a>k|<_JqpqrcUduM;afdVFa7fJzAMys^R(DrR zg2)+y8fqmuKq$xS>?S{gWOoxmws*4|tT))K69j8768*3#KV&-yj3J!(M-aqVBtQ^s z{`hAW0g_W)UDbW>?K`}~xui&`dN8-U`cZxQRCRS#o$q{Swt>f@E35Hq4M(h(UVWQ2 zkZs#z@hdl0UTdJ#9gD9sy2g?Q3Ve^H2s=I=OINR7rE75Y8|?b)udc3SC#F}}TKo#T z-iQMlM+n*54ZUa$Xbor$Xbor$Xbor$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x~oEIa{Aaf2dL%)D#;Ykoj#y_YXf?e&Sf+K0BwbH ziMIA+$3Fu!x?24gC?pwdHz;GD()oX9Phs`_Z*JIdG4uyP=pfra7;t_mL!)rvgI<9m zy2pLu_3s~q7rvT>@4!OzT2`P`wseFTl`(AlROWnfQ#~wI7t6=7O|i_;?Gn1Lh3`BD zSx?;LGL}mDo5}Kj0E|uR_)%9*g7GF9G&&L#3hOuSKE}flzubxPjE^bT46HxZ`G2TvH spV4`awPPUsr~S00?pFKzC4GxeX8>CeBD8=`!=}fyzGfC~Tng>}2T*K~fB*mh diff --git a/src/main/java/ru/ulstu/is/lab1/DataBase/controller/CollectionMvcController.java b/src/main/java/ru/ulstu/is/lab1/DataBase/controller/CollectionMvcController.java index 7129c6f..54505fa 100644 --- a/src/main/java/ru/ulstu/is/lab1/DataBase/controller/CollectionMvcController.java +++ b/src/main/java/ru/ulstu/is/lab1/DataBase/controller/CollectionMvcController.java @@ -6,9 +6,10 @@ import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import ru.ulstu.is.lab1.DataBase.service.CollectionService; import ru.ulstu.is.lab1.DataBase.service.FilmService; -import ru.ulstu.is.lab1.DataBase.service.GenreService; +import ru.ulstu.is.lab1.DataBase.model.Film; import javax.validation.Valid; +import java.util.List; @Controller @RequestMapping("/collection") @@ -31,6 +32,23 @@ public class CollectionMvcController { return "collection"; } + @GetMapping("/films/{id}") + public String getFilmsFromCollection(@PathVariable Long id, Model model) { + List films = collectionService.getFilmsFromCollection(id); + model.addAttribute("films", films); + return "view-films"; + } + + @GetMapping("getFilms/{id}") + public String getFilms(@PathVariable Long id, Model model) { + model.addAttribute("films", + filmService.findAllFilms().stream() + .map(FilmDTO::new) + .toList()); + model.addAttribute("collectionId", id); + return "add-film"; + } + @GetMapping(value = {"/edit", "/edit/{id}"}) public String editCollection(@PathVariable(required = false) Long id, Model model) { @@ -66,17 +84,11 @@ public class CollectionMvcController { return "redirect:/collection"; } - @PostMapping(value = "/add_film/{id}/{filmId}") + @PostMapping(value = "/add_film/{id}") public String addFilm(@PathVariable(value = "id") Long id, - @PathVariable(value = "filmId") Long filmId) { - collectionService.addFilm(id, filmId); - return "redirect:/collection"; - } - - @PostMapping(value = "/del_film/{id}/{filmId}") - public String deleteFilm(@PathVariable(value = "id") Long id, - @PathVariable(value = "filmId") Long filmId) { - collectionService.deleteFilm(id, filmId); - return "redirect:/collection"; + @RequestParam("filmId") String filmId) { + Long filmIdAsLong = Long.parseLong(filmId); + collectionService.addFilm(id, filmIdAsLong); + return "redirect:../films/{id}"; } } diff --git a/src/main/java/ru/ulstu/is/lab1/DataBase/controller/GenreMvcController.java b/src/main/java/ru/ulstu/is/lab1/DataBase/controller/GenreMvcController.java index 288dbd0..b8fa169 100644 --- a/src/main/java/ru/ulstu/is/lab1/DataBase/controller/GenreMvcController.java +++ b/src/main/java/ru/ulstu/is/lab1/DataBase/controller/GenreMvcController.java @@ -62,7 +62,7 @@ public class GenreMvcController { return "redirect:/genre"; } @GetMapping("/report/{id}") - public String findWorkersOnWorkplace(@PathVariable(required = false) Long id, Model model){ + public String findFilmsOnGenre(@PathVariable(required = false) Long id, Model model){ model.addAttribute("cathegory", "Фильмы по жанру: " + genreService.findGenre(id).getName()); model.addAttribute("films", genreService.findFilmOnGenre(id).stream() .map(FilmDTO::new) diff --git a/src/main/java/ru/ulstu/is/lab1/DataBase/service/CollectionService.java b/src/main/java/ru/ulstu/is/lab1/DataBase/service/CollectionService.java index d22d4cd..f1336e4 100644 --- a/src/main/java/ru/ulstu/is/lab1/DataBase/service/CollectionService.java +++ b/src/main/java/ru/ulstu/is/lab1/DataBase/service/CollectionService.java @@ -97,4 +97,15 @@ public class CollectionService { collection.removeFilm(film); return collectionRepository.save(collection); } + + @Transactional + public List getFilmsFromCollection(Long collectionId){ + Optional collectionOptional = collectionRepository.findById(collectionId); + if (collectionOptional.isPresent()) { + Collection collection = collectionOptional.get(); + return collection.getFilms(); + } else { + throw new IllegalArgumentException("Collection not found with id: " + collectionId); + } + } } diff --git a/src/main/resources/templates/add-film.html b/src/main/resources/templates/add-film.html new file mode 100644 index 0000000..c2f0dd8 --- /dev/null +++ b/src/main/resources/templates/add-film.html @@ -0,0 +1,28 @@ + + + + + +
+
+
+
+

Выберите фильм:

+ +
+
+ + + Назад + +
+
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/collection.html b/src/main/resources/templates/collection.html index e0930d4..3c285a1 100644 --- a/src/main/resources/templates/collection.html +++ b/src/main/resources/templates/collection.html @@ -34,6 +34,12 @@ th:attr="onclick=|confirm('Удалить запись?') && document.getElementById('remove-${collection.id}').click()|"> Удалить + + Посмотреть фильмы + + Добавить фильмы