работают контроллеры для админа и пользователя по категориям и частично по фильмам
This commit is contained in:
parent
1fe72328a0
commit
a53c4fff2d
@ -0,0 +1,41 @@
|
||||
package com.example.backend.categories.api;
|
||||
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.example.backend.categories.model.CategorieEntity;
|
||||
import com.example.backend.categories.service.CategorieService;
|
||||
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(CategorieUserController.URL)
|
||||
public class CategorieUserController {
|
||||
|
||||
public static final String URL = "/categories";
|
||||
private static final String CATEGORIE_VIEW = "categories";
|
||||
|
||||
private final CategorieService categorieService;
|
||||
private final ModelMapper modelMapper;
|
||||
|
||||
public CategorieUserController(CategorieService categorieService, ModelMapper modelMapper) {
|
||||
this.categorieService = categorieService;
|
||||
this.modelMapper = modelMapper;
|
||||
}
|
||||
|
||||
private CategorieDTO toDto(CategorieEntity entity) {
|
||||
return modelMapper.map(entity, CategorieDTO.class);
|
||||
}
|
||||
|
||||
@GetMapping()
|
||||
public String getAll(Model model) {
|
||||
model.addAttribute(
|
||||
"categories",
|
||||
categorieService.getAll().stream()
|
||||
.map(this::toDto)
|
||||
.toList());
|
||||
return CATEGORIE_VIEW;
|
||||
}
|
||||
}
|
@ -1,20 +1,13 @@
|
||||
package com.example.backend.movies.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.example.backend.categories.service.CategorieService;
|
||||
import com.example.backend.core.api.PageAttributesMapper;
|
||||
import com.example.backend.core.configurations.Constants;
|
||||
import com.example.backend.movies.model.MovieEntity;
|
||||
import com.example.backend.movies.service.MovieService;
|
||||
import com.example.backend.users.api.UserDTO;
|
||||
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
@ -22,14 +15,11 @@ import org.springframework.validation.BindingResult;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(MovieController.URL)
|
||||
|
@ -0,0 +1,90 @@
|
||||
package com.example.backend.movies.api;
|
||||
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.example.backend.categories.service.CategorieService;
|
||||
import com.example.backend.core.configurations.Constants;
|
||||
import com.example.backend.movies.model.MovieEntity;
|
||||
import com.example.backend.movies.service.MovieService;
|
||||
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(MovieUserController.URL)
|
||||
public class MovieUserController {
|
||||
|
||||
public static final String URL = "/movies";
|
||||
private static final String MOVIE_VIEW = "movies";
|
||||
private static final String MOVIE_EDIT_VIEW = "movie-edit";
|
||||
private static final String PAGE_ATTRIBUTE = "page";
|
||||
private static final String MOVIE_ATTRIBUTE = "movie";
|
||||
private static final String CATEGORIEID_ATTRIBUTE = "categorieId";
|
||||
|
||||
private final MovieService movieService;
|
||||
private final CategorieService categorieService;
|
||||
private final ModelMapper modelMapper;
|
||||
|
||||
public MovieUserController(MovieService movieService, CategorieService categorieService, ModelMapper modelMapper) {
|
||||
this.modelMapper = modelMapper;
|
||||
this.categorieService = categorieService;
|
||||
this.movieService = movieService;
|
||||
}
|
||||
|
||||
private MovieDTO toDto(MovieEntity entity) {
|
||||
return modelMapper.map(entity, MovieDTO.class);
|
||||
}
|
||||
|
||||
private MovieEntity toEntity(MovieDTO dto) {
|
||||
final MovieEntity entity = modelMapper.map(dto, MovieEntity.class);
|
||||
entity.setCategorie(categorieService.get(dto.getCategorieId()));
|
||||
return entity;
|
||||
}
|
||||
|
||||
@GetMapping()
|
||||
public String getAll(@RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page,
|
||||
Model model) {
|
||||
model.addAttribute("movies",
|
||||
movieService.getAll(0, page, Constants.DEFUALT_PAGE_SIZE)
|
||||
.stream()
|
||||
.map(this::toDto)
|
||||
.toList());
|
||||
model.addAttribute("categories", categorieService.getAll());
|
||||
|
||||
model.addAttribute(PAGE_ATTRIBUTE, page);
|
||||
model.addAttribute(CATEGORIEID_ATTRIBUTE, 0);
|
||||
return MOVIE_VIEW;
|
||||
}
|
||||
|
||||
@GetMapping("/categorieId/{id}")
|
||||
public String getAll(@PathVariable(name = "id") Integer categorieId,
|
||||
@RequestParam(name = PAGE_ATTRIBUTE, defaultValue = "0") int page,
|
||||
Model model) {
|
||||
model.addAttribute("movies",
|
||||
movieService.getAll(categorieId, page, Constants.DEFUALT_PAGE_SIZE)
|
||||
.stream()
|
||||
.map(this::toDto)
|
||||
.toList());
|
||||
model.addAttribute("categories", categorieService.getAll());
|
||||
|
||||
model.addAttribute(PAGE_ATTRIBUTE, page);
|
||||
model.addAttribute(CATEGORIEID_ATTRIBUTE, categorieId);
|
||||
return MOVIE_VIEW;
|
||||
}
|
||||
|
||||
@GetMapping("/countView")
|
||||
public Integer countView(@RequestParam(name = "movieId", defaultValue = "0") Integer movieId) {
|
||||
return movieService.countView(movieId);
|
||||
}
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
package com.example.backend.movies.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
0
backend/src/main/resources/public/favicon.ico
Normal file
0
backend/src/main/resources/public/favicon.ico
Normal file
@ -24,58 +24,88 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<th:block th:switch="${categories.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<th:block th:case="*">
|
||||
<div class="categories-container d-flex flex-row justify-content-center mt-3 mb-3">
|
||||
<div class="category-item d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||
th:each="categorie : ${categories}">
|
||||
<div class="category-card">
|
||||
<a th:href="@{/admin/movies/categorieId/{id}(id=${categorie.id})}">
|
||||
<img class="card-img-top rounded-3"
|
||||
th:src="${categorie.image != null ? 'data:image/jpeg;base64,' + categorie.image : 'https://live.funnelmates.com/wp-content/uploads/2021/08/placeholder-200x200-1-1-1.jpeg'}" />
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" th:text="${categorie.name}"></h5>
|
||||
<th:block sec:authorize="isAuthenticated()" th:with="userName=${#authentication.name}">
|
||||
<main layout:fragment="content">
|
||||
<th:block sec:authorize="hasRole('ADMIN')">
|
||||
<th:block th:switch="${categories.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<th:block th:case="*">
|
||||
<div class="categories-container d-flex flex-row justify-content-center mt-3 mb-3">
|
||||
<div class="category-item d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||
th:each="categorie : ${categories}">
|
||||
<div class="category-card">
|
||||
<a th:href="@{/admin/movies/categorieId/{id}(id=${categorie.id})}">
|
||||
<img class="card-img-top rounded-3"
|
||||
th:src="${categorie.image != null ? categorie.image : 'https://live.funnelmates.com/wp-content/uploads/2021/08/placeholder-200x200-1-1-1.jpeg'}" />
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" th:text="${categorie.name}"></h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-row me-ms-mt-2">
|
||||
<form th:action="@{/admin/categories/edit/{id}(id=${categorie.id})}" method="get">
|
||||
<button type="submit" class="btn btn-link button-link">
|
||||
<svg class="bi-edit-pen" viewBox="0 0 127 127" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M105.5 26L37 114.5C34.5 117 16.3 121.7 7.5 122.5C79.1 34.1 101 5.5 102 4C104.833 4.5 119.3 14.6 122.5 21C105 44 98.5 55 111.5 58.5"
|
||||
stroke="#008315" stroke-width="6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
<form th:action="@{/admin/categories/delete/{id}(id=${categorie.id})}"
|
||||
method="post">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
<svg class="bi-cart-delete" viewBox="0 0 154 164" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M44.5 123C4.99995 119.5 -11.8431 56.4293 24 19.5C40.5 2.50001 72.5 -5.5 101.5 27.5L115.5 14.5"
|
||||
stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
<path
|
||||
d="M65.2123 159.963L56 60.0001C88.0236 76.3307 119.521 77.4194 149 60.0001C141.63 142.346 140.08 160.953 140.226 159.963H65.2123Z"
|
||||
stroke="#D10000" stroke-width="8" />
|
||||
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8"
|
||||
stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-row me-ms-mt-2">
|
||||
<form th:action="@{/admin/categories/edit/{id}(id=${categorie.id})}" method="get">
|
||||
<button type="submit" class="btn btn-link button-link">
|
||||
<svg class="bi-edit-pen" viewBox="0 0 127 127" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M105.5 26L37 114.5C34.5 117 16.3 121.7 7.5 122.5C79.1 34.1 101 5.5 102 4C104.833 4.5 119.3 14.6 122.5 21C105 44 98.5 55 111.5 58.5"
|
||||
stroke="#008315" stroke-width="6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
<form th:action="@{/admin/categories/delete/{id}(id=${categorie.id})}" method="post">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
<svg class="bi-cart-delete" viewBox="0 0 154 164" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M44.5 123C4.99995 119.5 -11.8431 56.4293 24 19.5C40.5 2.50001 72.5 -5.5 101.5 27.5L115.5 14.5"
|
||||
stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
<path
|
||||
d="M65.2123 159.963L56 60.0001C88.0236 76.3307 119.521 77.4194 149 60.0001C141.63 142.346 140.08 160.953 140.226 159.963H65.2123Z"
|
||||
stroke="#D10000" stroke-width="8" />
|
||||
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8"
|
||||
stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
<div class="d-flex flex-row me-2 justify-content-center mt-3 mb-3">
|
||||
<a th:href="@{/admin/categories/edit/}" class="btn btn-primary">Добавить категорию</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-row me-2 justify-content-center mt-3 mb-3">
|
||||
<a th:href="@{/admin/categories/edit/}" class="btn btn-primary">Добавить категорию</a>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</main>
|
||||
|
||||
<th:block sec:authorize="hasRole('USER')">
|
||||
<th:block th:switch="${categories.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<th:block th:case="*">
|
||||
<div class="categories-container d-flex flex-row justify-content-center mt-3 mb-3">
|
||||
<div class="category-item d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||
th:each="categorie : ${categories}">
|
||||
<div class="category-card mt-3 mb-3">
|
||||
<a th:href="@{/movies/categorieId/{id}(id=${categorie.id})}">
|
||||
<img class="card-img-top rounded-3"
|
||||
th:src="${categorie.image != null ? categorie.image : 'https://live.funnelmates.com/wp-content/uploads/2021/08/placeholder-200x200-1-1-1.jpeg'}" />
|
||||
</a>
|
||||
<div class="card-body mb-3">
|
||||
<h5 class="card-title" th:text="${categorie.name}"></h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
</main>
|
||||
|
||||
</th:block>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -25,61 +25,116 @@
|
||||
|
||||
<body>
|
||||
<main layout:fragment="content">
|
||||
<th:block th:switch="${movies.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<div class="d-flex flex-row me-2 justify-content-center mt-3 mb-3">
|
||||
<a th:href="@{/admin/movies/edit/(page=${page})}" class="btn btn-primary">Добавить фильм</a>
|
||||
</div>
|
||||
<th:block th:case="*">
|
||||
<div class="categories-container d-flex flex-row justify-content-center mt-3 mb-3">
|
||||
<div class="category-item d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||
th:each="movie : ${movies}">
|
||||
<div class="category-card">
|
||||
<img class="card-img-top rounded-3"
|
||||
th:src="|https://live.funnelmates.com/wp-content/uploads/2021/08/placeholder-200x200-1-1-1.jpeg|" />
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" th:text="${movie.name}"></h5>
|
||||
|
||||
<th:block sec:authorize="hasRole('ADMIN')">
|
||||
<th:block th:switch="${movies.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<div class="d-flex flex-row me-2 justify-content-center mt-3 mb-3">
|
||||
<a th:href="@{/admin/movies/edit/(page=${page})}" class="btn btn-primary">Добавить фильм</a>
|
||||
</div>
|
||||
<th:block th:case="*">
|
||||
<div class="categories-container d-flex flex-row justify-content-center mt-3 mb-3">
|
||||
<div class="category-item d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||
th:each="movie : ${movies}">
|
||||
<div class="category-card">
|
||||
<img class="card-img-top rounded-3"
|
||||
th:src="|https://live.funnelmates.com/wp-content/uploads/2021/08/placeholder-200x200-1-1-1.jpeg|" />
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" th:text="${movie.name}"></h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-row me-ms-mt-2">
|
||||
<form th:action="@{/admin/movies/edit/{id}(id=${movie.id})}" method="get">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link">
|
||||
<svg class="bi-edit-pen" viewBox="0 0 127 127" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M105.5 26L37 114.5C34.5 117 16.3 121.7 7.5 122.5C79.1 34.1 101 5.5 102 4C104.833 4.5 119.3 14.6 122.5 21C105 44 98.5 55 111.5 58.5"
|
||||
stroke="#008315" stroke-width="6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
<form th:action="@{/admin/movies/delete/{id}(id=${movie.id})}" method="post">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
<svg class="bi-cart-delete" viewBox="0 0 154 164" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M44.5 123C4.99995 119.5 -11.8431 56.4293 24 19.5C40.5 2.50001 72.5 -5.5 101.5 27.5L115.5 14.5"
|
||||
stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
<path
|
||||
d="M65.2123 159.963L56 60.0001C88.0236 76.3307 119.521 77.4194 149 60.0001C141.63 142.346 140.08 160.953 140.226 159.963H65.2123Z"
|
||||
stroke="#D10000" stroke-width="8" />
|
||||
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8"
|
||||
stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-row me-ms-mt-2">
|
||||
<form th:action="@{/admin/movies/edit/{id}(id=${movie.id})}" method="get">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link">
|
||||
<svg class="bi-edit-pen" viewBox="0 0 127 127" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M105.5 26L37 114.5C34.5 117 16.3 121.7 7.5 122.5C79.1 34.1 101 5.5 102 4C104.833 4.5 119.3 14.6 122.5 21C105 44 98.5 55 111.5 58.5"
|
||||
stroke="#008315" stroke-width="6" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
<form th:action="@{/admin/movies/delete/{id}(id=${movie.id})}" method="post">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
<svg class="bi-cart-delete" viewBox="0 0 154 164" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M44.5 123C4.99995 119.5 -11.8431 56.4293 24 19.5C40.5 2.50001 72.5 -5.5 101.5 27.5L115.5 14.5"
|
||||
stroke="#D10000" stroke-width="8" stroke-linecap="round" />
|
||||
<path
|
||||
d="M65.2123 159.963L56 60.0001C88.0236 76.3307 119.521 77.4194 149 60.0001C141.63 142.346 140.08 160.953 140.226 159.963H65.2123Z"
|
||||
stroke="#D10000" stroke-width="8" />
|
||||
<path d="M121 36L101.582 55L75 31" stroke="#D10000" stroke-width="8"
|
||||
stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</th:block>
|
||||
</th:block>
|
||||
</th:block>
|
||||
<th:block th:replace="~{ pagination :: pagination (
|
||||
<th:block th:replace="~{ pagination :: pagination (
|
||||
url=${'admin/movies'},
|
||||
totalPages=${totalPages},
|
||||
currentPage=${currentPage}) }" />
|
||||
</th:block>
|
||||
|
||||
|
||||
<th:block sec:authorize="hasRole('USER')">
|
||||
<th:block th:switch="${movies.size()}">
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<th:block th:case="*">
|
||||
<div class="categories-container d-flex flex-row justify-content-center mt-3 mb-3">
|
||||
<div class="category-item d-flex flex-column justify-content-center align-items-center mb-5 mb-md-0"
|
||||
th:each="movie : ${movies}">
|
||||
<div class="category-card">
|
||||
<img class="card-img-top rounded-3"
|
||||
th:src="|https://live.funnelmates.com/wp-content/uploads/2021/08/placeholder-200x200-1-1-1.jpeg|" />
|
||||
<div class="card-body">
|
||||
<h5 class="card-title" th:text="${movie.name}"></h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-row me-ms-mt-2">
|
||||
<!-- <form th:action="@{/movies/edit/{id}(id=${movie.id})}" method="get"> -->
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-heart-fill" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd"
|
||||
d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314" />
|
||||
</svg>
|
||||
</button>
|
||||
<!-- </form> -->
|
||||
<!-- <form th:action="@{/movies/delete/{id}(id=${movie.id})}" method="post"> -->
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||
class="bi bi-eye-fill" viewBox="0 0 16 16">
|
||||
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0" />
|
||||
<path
|
||||
d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8m8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7" />
|
||||
</svg>
|
||||
</button>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</th:block>
|
||||
</th:block>
|
||||
<th:block th:replace="~{ pagination :: pagination (
|
||||
url=${'movies'},
|
||||
totalPages=${totalPages},
|
||||
currentPage=${currentPage}) }" />
|
||||
</th:block>
|
||||
|
||||
|
||||
</main>
|
||||
</body>
|
||||
|
||||
|
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
@ -815,3 +815,35 @@ Caused by: org.h2.mvstore.MVStoreException: The file is locked: D:/code/PIbd-21_
|
||||
at org.h2.mvstore.SingleFileStore.open(SingleFileStore.java:81)
|
||||
at org.h2.mvstore.MVStore.<init>(MVStore.java:286)
|
||||
... 60 more
|
||||
2024-06-17 23:16:01.589022+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 10 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 10 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-17 23:17:44.595115+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 9 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 9 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-17 23:20:54.688760+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 9 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 9 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-17 23:22:52.663341+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 13 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 13 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-18 20:37:32.784955+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 9 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 9 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-18 20:44:02.945094+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 14 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 14 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-18 20:52:02.831015+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 20 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 20 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
2024-06-18 20:52:23.440573+04:00 jdbc[3]: exception
|
||||
org.h2.jdbc.JdbcSQLDataException: Ошибка преобразования данных при конвертации "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 21 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"
|
||||
Data conversion error converting "CAST(REPEAT(CHAR(0), 9861) AS BINARY VARYING /* table: -3 id: 21 */) (CATEGORIES_COPY_3_0: ""IMAGE"" CHARACTER VARYING(255))"; SQL statement:
|
||||
INSERT INTO "PUBLIC"."CATEGORIES_COPY_3_0"("ID", "NAME", "IMAGE") OVERRIDING SYSTEM VALUE SELECT "ID", "NAME", "IMAGE" FROM "PUBLIC"."CATEGORIES" [22018-224]
|
||||
|
Loading…
x
Reference in New Issue
Block a user