meetings #8

Merged
romanov73 merged 10 commits from 7-meetings into master 2022-03-18 11:14:19 +04:00
4 changed files with 34 additions and 14 deletions
Showing only changes of commit 2b30a22984 - Show all commits

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 { plugins {
id 'java' id 'java'
id 'io.spring.dependency-management' version '1.0.9.RELEASE' id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.springframework.boot' version '2.3.3.RELEASE' id 'org.springframework.boot' version '2.6.4'
id "org.sonarqube" version "2.7"
} }
jar { jar {
@ -18,11 +11,12 @@ jar {
repositories { repositories {
maven { maven {
url "http://repo.athene.tech/repository/maven-central/" url "http://repo.athene.tech/repository/maven-central/"
allowInsecureProtocol(true)
} }
} }
sourceCompatibility = 11 sourceCompatibility = 17
targetCompatibility = 11 targetCompatibility = 17
dependencies { dependencies {
ext { 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-data-jpa'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security'
implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J 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: 'org.thymeleaf.extras', name: 'thymeleaf-extras-springsecurity5'
implementation group: 'com.h2database', name:'h2' implementation group: 'com.h2database', name:'h2'
implementation group: 'javax.xml.bind', name:'jaxb-api' implementation group: 'javax.xml.bind', name:'jaxb-api'

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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; 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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect; 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 org.springframework.data.domain.Sort;
import java.io.Serializable; import java.io.Serializable;
import java.util.Optional;
public class OffsetablePageRequest implements Pageable, Serializable { public class OffsetablePageRequest implements Pageable, Serializable {
private final int offset; private final int offset;
@ -31,11 +32,26 @@ public class OffsetablePageRequest implements Pageable, Serializable {
return sort; return sort;
} }
@Override
public Sort getSortOr(Sort sort) {
return Pageable.super.getSortOr(sort);
}
@Override @Override
public int getPageSize() { public int getPageSize() {
return count; return count;
} }
@Override
public boolean isPaged() {
return Pageable.super.isPaged();
}
@Override
public boolean isUnpaged() {
return Pageable.super.isUnpaged();
}
@Override @Override
public int getPageNumber() { public int getPageNumber() {
return offset / count; return offset / count;
@ -51,6 +67,11 @@ public class OffsetablePageRequest implements Pageable, Serializable {
return offset > 0; return offset > 0;
} }
@Override
public Optional<Pageable> toOptional() {
return Pageable.super.toOptional();
}
@Override @Override
public Pageable next() { public Pageable next() {
return new OffsetablePageRequest(getOffset() + getPageSize(), getPageSize(), getSort()); return new OffsetablePageRequest(getOffset() + getPageSize(), getPageSize(), getSort());
@ -70,6 +91,11 @@ public class OffsetablePageRequest implements Pageable, Serializable {
return new OffsetablePageRequest(0, getPageSize(), getSort()); return new OffsetablePageRequest(0, getPageSize(), getSort());
} }
@Override
public Pageable withPage(int pageNumber) {
return null;
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) { if (this == obj) {