diff --git a/build.gradle b/build.gradle index eedb56e..e1ad653 100644 --- a/build.gradle +++ b/build.gradle @@ -14,11 +14,20 @@ repositories { dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' + implementation 'org.springframework.boot:spring-boot-devtools' + implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' + + implementation 'org.webjars:bootstrap:5.1.3' + implementation 'org.webjars:jquery:3.6.0' + implementation 'org.webjars:font-awesome:6.1.0' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'com.h2database:h2:2.1.210' - implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.5' + implementation 'org.hibernate.validator:hibernate-validator' + + implementation 'org.springdoc:springdoc-openapi-ui:1.6.5' testImplementation 'org.springframework.boot:spring-boot-starter-test' } diff --git a/data.mv.db b/data.mv.db index ae05821..e070829 100644 Binary files a/data.mv.db and b/data.mv.db differ diff --git a/frontend/src/components/Banner.css b/frontend/src/components/Banner.css index 73d2c51..ceda714 100644 --- a/frontend/src/components/Banner.css +++ b/frontend/src/components/Banner.css @@ -1,6 +1,5 @@ .banner-block { width: 90%; - } .banner-card { diff --git a/src/main/java/ru/ip/labs/labs/WebConfiguration.java b/src/main/java/ru/ip/labs/labs/WebConfiguration.java index 5b2ede4..f01a266 100644 --- a/src/main/java/ru/ip/labs/labs/WebConfiguration.java +++ b/src/main/java/ru/ip/labs/labs/WebConfiguration.java @@ -2,12 +2,27 @@ package ru.ip.labs.labs; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class WebConfiguration implements WebMvcConfigurer { + public static final String REST_API = "/api"; + @Override + public void addViewControllers(ViewControllerRegistry registry) { + WebMvcConfigurer.super.addViewControllers(registry); + registry.addViewController("films"); + registry.addViewController("contacts"); + registry.addViewController("catalogs"); + } @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedMethods("*"); } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/static/css/**").addResourceLocations("/static/css/"); + } } \ No newline at end of file diff --git a/src/main/java/ru/ip/labs/labs/films/controller/ActorController.java b/src/main/java/ru/ip/labs/labs/films/controller/ActorController.java index 39ef2f4..4b18489 100644 --- a/src/main/java/ru/ip/labs/labs/films/controller/ActorController.java +++ b/src/main/java/ru/ip/labs/labs/films/controller/ActorController.java @@ -1,6 +1,7 @@ package ru.ip.labs.labs.films.controller; import org.springframework.web.bind.annotation.*; +import ru.ip.labs.labs.WebConfiguration; import ru.ip.labs.labs.films.dto.ActorDTO; import ru.ip.labs.labs.films.service.ActorService; @@ -8,7 +9,7 @@ import javax.validation.Valid; import java.util.List; @RestController -@RequestMapping("/actors") +@RequestMapping(WebConfiguration.REST_API + "/actors") public class ActorController { private final ActorService actorService; diff --git a/src/main/java/ru/ip/labs/labs/films/controller/FilmController.java b/src/main/java/ru/ip/labs/labs/films/controller/FilmController.java index a296fc7..e8e4d4a 100644 --- a/src/main/java/ru/ip/labs/labs/films/controller/FilmController.java +++ b/src/main/java/ru/ip/labs/labs/films/controller/FilmController.java @@ -1,6 +1,7 @@ package ru.ip.labs.labs.films.controller; import org.springframework.web.bind.annotation.*; +import ru.ip.labs.labs.WebConfiguration; import ru.ip.labs.labs.films.dto.FilmDTO; import ru.ip.labs.labs.films.models.Film; import ru.ip.labs.labs.films.models.Genre; @@ -11,7 +12,7 @@ import java.util.Iterator; import java.util.List; @RestController -@RequestMapping("/films") +@RequestMapping(WebConfiguration.REST_API + "/films") public class FilmController { private final FilmsService filmService; diff --git a/src/main/java/ru/ip/labs/labs/films/controller/GenreController.java b/src/main/java/ru/ip/labs/labs/films/controller/GenreController.java index e0e2bc1..b8d9df8 100644 --- a/src/main/java/ru/ip/labs/labs/films/controller/GenreController.java +++ b/src/main/java/ru/ip/labs/labs/films/controller/GenreController.java @@ -1,6 +1,7 @@ package ru.ip.labs.labs.films.controller; import org.springframework.web.bind.annotation.*; +import ru.ip.labs.labs.WebConfiguration; import ru.ip.labs.labs.films.dto.FilmDTO; import ru.ip.labs.labs.films.dto.GenreDTO; import ru.ip.labs.labs.films.models.Film; @@ -12,7 +13,7 @@ import javax.validation.Valid; import java.util.List; @RestController -@RequestMapping("/genres") +@RequestMapping(WebConfiguration.REST_API + "/genres") public class GenreController { private final GenreService genreService; diff --git a/src/main/resources/static/css/Banner.css b/src/main/resources/static/css/Banner.css new file mode 100644 index 0000000..73d2c51 --- /dev/null +++ b/src/main/resources/static/css/Banner.css @@ -0,0 +1,23 @@ +.banner-block { + width: 90%; + +} + +.banner-card { + width: 0; + height: 0; + overflow: hidden; + opacity: 0.2; + transition: 0.5s opacity ease; +} + +.banner-card.active { + width: 100%; + height: auto; + opacity: 1; + margin: 0 auto; +} + +.banner-card.active img { + height: 75vh; +} \ No newline at end of file diff --git a/src/main/resources/static/css/Contacts.css b/src/main/resources/static/css/Contacts.css new file mode 100644 index 0000000..10a82c0 --- /dev/null +++ b/src/main/resources/static/css/Contacts.css @@ -0,0 +1,5 @@ +.map__frame { + width: 90%; + height: 500px; + margin-bottom: 30px; +} diff --git a/src/main/resources/static/css/Header.css b/src/main/resources/static/css/Header.css new file mode 100644 index 0000000..9bc2c51 --- /dev/null +++ b/src/main/resources/static/css/Header.css @@ -0,0 +1,21 @@ +.navbar__logo { + text-decoration: none; + margin-left: 30px; +} + +.navbar__logo-text { + font-size: 30px; + text-decoration: none; + color: white; +} + +.navbar__logo-text_first { + color: yellow; +} + +body { + margin: 0; + background: linear-gradient(135deg, #8bf292, #a5ebb1) fixed; + min-height: 100vh; + position: relative; +} diff --git a/src/main/resources/static/img/1.jpg b/src/main/resources/static/img/1.jpg new file mode 100644 index 0000000..11bd614 Binary files /dev/null and b/src/main/resources/static/img/1.jpg differ diff --git a/src/main/resources/static/img/2.jpg b/src/main/resources/static/img/2.jpg new file mode 100644 index 0000000..db5aeb6 Binary files /dev/null and b/src/main/resources/static/img/2.jpg differ diff --git a/src/main/resources/static/img/3.jpg b/src/main/resources/static/img/3.jpg new file mode 100644 index 0000000..97d7eec Binary files /dev/null and b/src/main/resources/static/img/3.jpg differ diff --git a/src/main/resources/static/img/4.jpg b/src/main/resources/static/img/4.jpg new file mode 100644 index 0000000..8a7b88e Binary files /dev/null and b/src/main/resources/static/img/4.jpg differ diff --git a/src/main/resources/static/img/5.jpg b/src/main/resources/static/img/5.jpg new file mode 100644 index 0000000..d885385 Binary files /dev/null and b/src/main/resources/static/img/5.jpg differ diff --git a/src/main/resources/static/img/play.png b/src/main/resources/static/img/play.png new file mode 100644 index 0000000..c06d8ee Binary files /dev/null and b/src/main/resources/static/img/play.png differ diff --git a/src/main/resources/templates/catalogs.html b/src/main/resources/templates/catalogs.html new file mode 100644 index 0000000..118fb42 --- /dev/null +++ b/src/main/resources/templates/catalogs.html @@ -0,0 +1,14 @@ + + + + + +
+ фильмы + жанры + актеры +
+ + \ No newline at end of file diff --git a/src/main/resources/templates/contacts.html b/src/main/resources/templates/contacts.html new file mode 100644 index 0000000..a83ddf3 --- /dev/null +++ b/src/main/resources/templates/contacts.html @@ -0,0 +1,14 @@ + + + + + + +
+

Контакты

+