From 04fea2fcc80ccac71c7bc1349bbd39ea67364014 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Mon, 15 May 2023 23:36:37 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=A04=20=D1=87=D0=B5=D0=BA=D0=B1=D0=BE?= =?UTF-8?q?=D0=BA=D1=81=D1=8B=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D1=8E?= =?UTF-8?q?=D1=82=20=D1=81=20=D0=B1=D0=B4!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/CatalogFilms.vue | 53 +++++++++--------- data.mv.db | Bin 69632 -> 57344 bytes .../DataBase/controller/FilmController.java | 5 ++ .../ru/ulstu/is/lab1/DataBase/model/Film.java | 4 ++ .../is/lab1/DataBase/service/FilmService.java | 11 ++++ 5 files changed, 46 insertions(+), 27 deletions(-) diff --git a/Frontend/vue-project/src/components/CatalogFilms.vue b/Frontend/vue-project/src/components/CatalogFilms.vue index c4d4744..96e159e 100644 --- a/Frontend/vue-project/src/components/CatalogFilms.vue +++ b/Frontend/vue-project/src/components/CatalogFilms.vue @@ -20,9 +20,10 @@ headersGenres: [ { name: 'name', label: 'Жанр' } ], - selectedItemsGenres: [], + selectedGenres: [], genreUrl: 'genre/', - genres: [] + genres: [], + open: [] } }, created() { @@ -32,15 +33,21 @@ }); }, methods: { - addGenre(filmId) { - let genreId = document.getElementById('genres').value; + addGenre(filmId, genreId) { let response = axios.post(`http://localhost:8080/film/add_genre/${filmId}?genre_id=${genreId}`); console.log(response); + return response; }, - delGenre(filmId) { - let genreId = document.getElementById('genres').value; - let response = axios.delete(`http://localhost:8080/film/del_genre/${filmId}?genre_id=${genreId}`); + delGenres(filmId) { + let response = axios.delete(`http://localhost:8080/film/del_genres/${filmId}`); console.log(response); + return response; + }, + async createGenres(filmId, genreIds){ + await this.delGenres(filmId); + for(var j=0; jНазвание фильма - - -
- - -
-
- - +
+ +
    +
  • +
    + + +
    +
  • +
+
\ No newline at end of file diff --git a/data.mv.db b/data.mv.db index d2d9af4e6ddf8b08fbf66732065402c2652f2d24..e9122c6419d4f45dc914e8ef7267db9d9143ae27 100644 GIT binary patch literal 57344 zcmeHQ33MFAneHxW?79ON=21VRFl1K~bG5=h8RPRPZ6)m7EqbI6h`IS<~} zNdI(KA60*URb5km{eS)c>JGCl*fJEJ+2QbQ|K|UWI;de7ZQ&U^2hZ#XqqcB+mS{LUBih~(IOU2Ln$ZkReG~!;0fm4< zKp~(IPzWdl6aoqXg@8gpA)pX=9U!n;$^Wl|T2L$~1QY@a0fm4>Ko1<%UwcPbOMS8Z@ zq|Zf~?P~{Wvq%dPIEPg8CCyhi;mUmcpzV$)c0yb36y=UDcY^6#qhY^&b9owj&~`eV zZw#@OX;Y*vewoQP4&MZP6Y`D7DdMThEjowY@dWI)fPKs6v!b=YoLWX3+g}$0ZpGE% zuv$60!*y$_!{OCIi@Z8q+Y!~_dR`RyuG6-2aOaMw+&R2Km};O{X|;jfZJP&I4DB2o zMy<2TDjMasp)lOJ%^wWU>7eu`!E0y>UW1rdE9NiewS)$eGVAfS!!~Dkn2sa3jYQ+2 zu4p~X#KbUM%XjRg^;mXT4C~lM$&y{{G9FDMEM}ODjL32;*GfiE#-w`B<`0Lt)L z)y93Circs&*fb@V9^;ZarBcdeP_oPhTozL=dBxLg#T%7`-9WJGjGJAFrev22 zG|iBqX_#TA$H=mm_8_%QHVjgBgP2_>aI)x9ozAi-hlAyhL|j(Uib5kv*tU&??6?ds zld#gu7=ymN$Mij#Bpjz~*z$~13|MZw9LKc`6e_YdLzcDRzzpo7rZw%-v^G#P$Y9&u znr4C6$GyTZ#>~1ZH+EOs6^3P{G%}|9y~+l4nQ+ zp`^e`??C=)c9y@T!#BzS zgt1c9eeS6D8D(mXeqU+S`}SI%Nk_e}uDrNjJ2u78cho|Ebo}rFdj6~x-*ij^^AdPg z$1|+Js?ek2%TT#Mv;L}zZM%kD@|N<<65Q*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8uG6mCzN+Wy(Q&|7n0mAld zd$wM5{y%?*XT`MuIZsyN&G6NDV-y*_ P6WR#v4>>Q}d*J^8RgJnx diff --git a/src/main/java/ru/ulstu/is/lab1/DataBase/controller/FilmController.java b/src/main/java/ru/ulstu/is/lab1/DataBase/controller/FilmController.java index d1937b3..5ca4a30 100644 --- a/src/main/java/ru/ulstu/is/lab1/DataBase/controller/FilmController.java +++ b/src/main/java/ru/ulstu/is/lab1/DataBase/controller/FilmController.java @@ -54,4 +54,9 @@ public class FilmController { public FilmDTO delGenre(@PathVariable Long id, @RequestParam Long genre_id) { return new FilmDTO(filmService.deleteGenre(id, genre_id)); } + + @DeleteMapping("/del_genres/{id}") + public FilmDTO delGenres(@PathVariable Long id) { + return new FilmDTO(filmService.deleteGenres(id)); + } } diff --git a/src/main/java/ru/ulstu/is/lab1/DataBase/model/Film.java b/src/main/java/ru/ulstu/is/lab1/DataBase/model/Film.java index 747c0d0..691640f 100644 --- a/src/main/java/ru/ulstu/is/lab1/DataBase/model/Film.java +++ b/src/main/java/ru/ulstu/is/lab1/DataBase/model/Film.java @@ -60,6 +60,10 @@ public class Film { } } + public void removeGenres(){ + genres = new ArrayList<>(); + } + public void addCollection(Collection collection) { if(this.collections==null) collections=new ArrayList<>(); diff --git a/src/main/java/ru/ulstu/is/lab1/DataBase/service/FilmService.java b/src/main/java/ru/ulstu/is/lab1/DataBase/service/FilmService.java index e19280b..9895231 100644 --- a/src/main/java/ru/ulstu/is/lab1/DataBase/service/FilmService.java +++ b/src/main/java/ru/ulstu/is/lab1/DataBase/service/FilmService.java @@ -97,4 +97,15 @@ public class FilmService { film.removeGenre(genre); return filmRepository.save(film); } + + @Transactional + public Film deleteGenres(Long filmId) { + Film film = findFilm(filmId); + if (film == null) { + throw new EntityNotFoundException(String.format("Film with id [%s] is not found", filmId)); + } + + film.removeGenres(); + return filmRepository.save(film); + } }