#7 -- upgrade spring version

This commit is contained in:
Anton Romanov 2022-03-15 10:44:43 +04:00
parent 9382fd72d6
commit 2b30a22984
4 changed files with 34 additions and 14 deletions

View File

@ -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'

View File

@ -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

View File

@ -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;

View File

@ -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<Pageable> 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) {