From 2b30a22984fd626c58df6df8cf8c13affcf26df0 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 15 Mar 2022 10:44:43 +0400 Subject: [PATCH] #7 -- upgrade spring version --- build.gradle | 18 +++++-------- gradle/wrapper/gradle-wrapper.properties | 2 +- .../configuration/TemplateConfiguration.java | 2 +- .../ru/ulstu/model/OffsetablePageRequest.java | 26 +++++++++++++++++++ 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 11f98dc..37bde79 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,7 @@ -/* - * Copyright (C) 2021 Anton Romanov - All Rights Reserved - * You may use, distribute and modify this code, please write to: romanov73@gmail.com. - * - */ - plugins { id 'java' - id 'io.spring.dependency-management' version '1.0.9.RELEASE' - id 'org.springframework.boot' version '2.3.3.RELEASE' - id "org.sonarqube" version "2.7" + id 'io.spring.dependency-management' version '1.0.11.RELEASE' + id 'org.springframework.boot' version '2.6.4' } jar { @@ -18,11 +11,12 @@ jar { repositories { maven { url "http://repo.athene.tech/repository/maven-central/" + allowInsecureProtocol(true) } } -sourceCompatibility = 11 -targetCompatibility = 11 +sourceCompatibility = 17 +targetCompatibility = 17 dependencies { ext { @@ -39,7 +33,7 @@ dependencies { implementation group: 'org.springframework.boot', name:'spring-boot-starter-data-jpa' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security' implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J - implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect' + implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect', version: '3.1.0' implementation group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-springsecurity5' implementation group: 'com.h2database', name:'h2' implementation group: 'javax.xml.bind', name:'jaxb-api' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 83d6bd2..d66f36f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip diff --git a/src/main/java/ru/ulstu/configuration/TemplateConfiguration.java b/src/main/java/ru/ulstu/configuration/TemplateConfiguration.java index f9ab6a7..3b697a0 100644 --- a/src/main/java/ru/ulstu/configuration/TemplateConfiguration.java +++ b/src/main/java/ru/ulstu/configuration/TemplateConfiguration.java @@ -6,7 +6,7 @@ package ru.ulstu.configuration; -import nz.net.ultraq.thymeleaf.LayoutDialect; +import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect; diff --git a/src/main/java/ru/ulstu/model/OffsetablePageRequest.java b/src/main/java/ru/ulstu/model/OffsetablePageRequest.java index c715296..cd4a603 100644 --- a/src/main/java/ru/ulstu/model/OffsetablePageRequest.java +++ b/src/main/java/ru/ulstu/model/OffsetablePageRequest.java @@ -4,6 +4,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import java.io.Serializable; +import java.util.Optional; public class OffsetablePageRequest implements Pageable, Serializable { private final int offset; @@ -31,11 +32,26 @@ public class OffsetablePageRequest implements Pageable, Serializable { return sort; } + @Override + public Sort getSortOr(Sort sort) { + return Pageable.super.getSortOr(sort); + } + @Override public int getPageSize() { return count; } + @Override + public boolean isPaged() { + return Pageable.super.isPaged(); + } + + @Override + public boolean isUnpaged() { + return Pageable.super.isUnpaged(); + } + @Override public int getPageNumber() { return offset / count; @@ -51,6 +67,11 @@ public class OffsetablePageRequest implements Pageable, Serializable { return offset > 0; } + @Override + public Optional toOptional() { + return Pageable.super.toOptional(); + } + @Override public Pageable next() { return new OffsetablePageRequest(getOffset() + getPageSize(), getPageSize(), getSort()); @@ -70,6 +91,11 @@ public class OffsetablePageRequest implements Pageable, Serializable { return new OffsetablePageRequest(0, getPageSize(), getSort()); } + @Override + public Pageable withPage(int pageNumber) { + return null; + } + @Override public boolean equals(Object obj) { if (this == obj) {