Compare commits

...

41 Commits

Author SHA1 Message Date
6cd9512ec7
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-14 14:49:08 +03:00
817a891a92
[maven-release-plugin] prepare release v.1.6.0
All checks were successful
continuous-integration/drone/tag Build is passing
2024-10-14 14:49:08 +03:00
adc3456e07
<haiti.filter.jooq.version>1.4.0</haiti.filter.jooq.version> 2024-10-14 14:48:50 +03:00
df7666ef14
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-24 15:54:31 +03:00
b90f9db3f2
[maven-release-plugin] prepare release v.1.5.1
All checks were successful
continuous-integration/drone/tag Build is passing
2024-06-24 15:54:31 +03:00
e3675896e5
Обновление версий
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-24 15:53:55 +03:00
951e65b09b
[maven-release-plugin] prepare for next development iteration
Some checks failed
continuous-integration/drone/push Build is failing
2024-06-14 15:57:55 +03:00
1dcaf689b7
[maven-release-plugin] prepare release v.1.5.0
Some checks failed
continuous-integration/drone/tag Build is failing
2024-06-14 15:57:55 +03:00
28ab5f1261
Обновление версий
Some checks failed
continuous-integration/drone/push Build is failing
2024-06-14 15:57:30 +03:00
d3421fe295
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-13 13:28:38 +03:00
ff3a33d4ec
[maven-release-plugin] prepare release v.1.4.0 2024-03-13 13:28:38 +03:00
005c810d7f
<haiti.filter.jooq.version>1.2.4</haiti.filter.jooq.version> 2024-03-13 13:27:39 +03:00
52da77f724
<haiti.filter.jooq.version>1.2.0</haiti.filter.jooq.version> 2024-03-13 13:12:51 +03:00
aa267de51f
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-19 11:24:37 +03:00
d34e65f633
[maven-release-plugin] prepare release v.1.3.0 2024-02-19 11:24:37 +03:00
1a34ca56a8
quarkus version 3.0.3.Final -> 3.4.3 2024-02-19 11:24:08 +03:00
eae367c5e6
Раскоментировал использование sortFieldNames 2024-02-19 11:20:29 +03:00
b523315714
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-09 17:43:47 +03:00
c3e60c5a48
[maven-release-plugin] prepare release v.1.2.2 2024-01-09 17:43:46 +03:00
a81e0cd509
update base dockerimage cicd [skip ci] 2024-01-09 17:43:19 +03:00
e502ff7644
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-09 14:52:03 +03:00
b27abcd32b
[maven-release-plugin] prepare release v.1.2.1 2024-01-09 14:52:03 +03:00
0a29a0ab8c
update base dockerimage cicd [skip ci] 2024-01-09 14:51:33 +03:00
69496ce01c
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-09 14:42:57 +03:00
c503738e21
[maven-release-plugin] prepare release v.1.2.0 2024-01-09 14:41:50 +03:00
6dc634e511
Добавил возможность передавать свой мапинг
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-09 13:58:45 +03:00
5030542338
update cicd
All checks were successful
continuous-integration/drone/push Build is passing
2023-12-03 09:57:50 +03:00
972ac2b3c3
Merge branch 'bugfix/sort-group' into develop
Some checks failed
continuous-integration/drone/push Build is failing
# Conflicts:
#	pom.xml
2023-05-23 16:06:13 +03:00
98ab91fb6a
[maven-release-plugin] prepare for next development iteration 2023-05-23 16:04:42 +03:00
3f8987875c
[maven-release-plugin] prepare release v.1.0.1 2023-05-23 16:04:42 +03:00
aa7db91d40
[maven-release-plugin] prepare for next development iteration 2023-05-23 16:04:14 +03:00
a07e52df56
fix v.1.0.1 2023-05-23 16:03:13 +03:00
44e8dc5253
Убрал добавление groupBy по полям сортировки 2023-05-23 16:02:12 +03:00
156048a348
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-17 23:09:39 +03:00
0d0a0c7859
[maven-release-plugin] prepare release v.1.1.0 2023-05-17 23:09:39 +03:00
92d9c07f44
переход на quarkus 3 2023-05-17 23:09:17 +03:00
892c92ff04
[maven-release-plugin] prepare for next development iteration
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 12:59:35 +03:00
117b575d58
[maven-release-plugin] prepare release v.1.0.0 2023-05-11 12:59:34 +03:00
e8107a3012
Настройка CICD 2023-05-11 12:59:08 +03:00
62f4682d81 v.0.8.0 2022-12-07 09:35:12 +03:00
Struchkov Mark
2d00fd8f96 InitNextRelease 2022-04-02 11:20:47 +03:00
5 changed files with 278 additions and 58 deletions

111
.drone.yml Normal file
View File

@ -0,0 +1,111 @@
---
kind: pipeline
type: docker
name: snapshot-publish
trigger:
branch:
- develop
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish
image: hub.docker.struchkov.dev/maven:3.9.5-eclipse-temurin-17-alpine
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
commands:
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- mvn --settings maven-settings.xml -U -P snapshot clean deploy
image_pull_secrets:
- DOCKER_AUTH
---
kind: pipeline
type: docker
name: release-maven-central
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish maven central
image: hub.docker.struchkov.dev/maven:3.9.6-eclipse-temurin-17-alpine
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
GPG_PRIVATE_KEY:
from_secret: GPG_PRIVATE_KEY
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
GPG_PASSPHRASE:
from_secret: GPG_PASSPHRASE
commands:
- apk add --no-cache gnupg
- echo "$GPG_PRIVATE_KEY" >> gpg.key
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE --import gpg.key
- mvn --settings maven-settings.xml -U -P ossrh,release clean deploy
image_pull_secrets:
- DOCKER_AUTH
---
kind: pipeline
type: docker
name: release-struchkov-nexus
trigger:
ref:
- refs/tags/v.*.*.*
volumes:
- name: m2
host:
path: /drone/volume/m2
steps:
- name: publish struchkov nexus
image: hub.docker.struchkov.dev/maven:3.9.5-eclipse-temurin-17-alpine
privileged: true
volumes:
- name: m2
path: /root/.m2/repository
environment:
GPG_PRIVATE_KEY:
from_secret: GPG_PRIVATE_KEY
MAVEN_SETTINGS:
from_secret: MAVEN_SETTINGS
GPG_PASSPHRASE:
from_secret: GPG_PASSPHRASE
commands:
- apk add --no-cache gnupg
- echo "$GPG_PRIVATE_KEY" >> gpg.key
- echo "$MAVEN_SETTINGS" >> maven-settings.xml
- gpg --pinentry-mode loopback --passphrase $GPG_PASSPHRASE --import gpg.key
- mvn --settings maven-settings.xml -U -P ossrh,release-struchkov-nexus clean deploy
image_pull_secrets:
- DOCKER_AUTH
---
kind: signature
hmac: 5a61d8c658a4be1aa3afed536582b5905bb044ad1269bc8734e7f63b31572f1f
...

19
.gitignore vendored
View File

@ -20,23 +20,8 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/**/contentModel.xml
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
.idea/**/gradle.xml
.idea/**/libraries
.idea/
cmake-build-*/
.idea/**/mongoSettings.xml
*.iws
out/
.idea_modules/
@ -46,8 +31,6 @@ com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
.idea/httpRequests
.idea/caches/build_file_checksums.ser
*~
.fuse_hidden*
.directory

167
pom.xml
View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dev.struchkov.haiti.filter</groupId>
<artifactId>haiti-filter-quarkus-reactive</artifactId>
<version>0.5.0</version>
<version>1.6.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Haiti Filter Reactive Quarkus</name>
@ -24,20 +22,31 @@
</issueManagement>
<properties>
<java.version>11</java.version>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.version>2.5.1.Final</quarkus.platform.version>
<haiti.filter.jooq.version>0.5.0</haiti.filter.jooq.version>
<quarkus.platform.version>3.8.4</quarkus.platform.version>
<haiti.filter.jooq.version>1.4.0</haiti.filter.jooq.version>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<postgresql.ver>42.7.3</postgresql.ver>
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<jetbrains.annotations.ver>24.0.1</jetbrains.annotations.ver>
<plugin.maven.compiler.ver>3.9.0</plugin.maven.compiler.ver>
<plugin.nexus.staging.ver>1.6.8</plugin.nexus.staging.ver>
<plugin.maven.source.ver>3.2.1</plugin.maven.source.ver>
<plugin.maven.javadoc.ver>3.3.1</plugin.maven.javadoc.ver>
<plugin.maven.gpg.ver>3.0.1</plugin.maven.gpg.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
<plugin.maven.compiler.ver>3.13.0</plugin.maven.compiler.ver>
<!-- https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin -->
<plugin.nexus.staging.ver>1.7.0</plugin.nexus.staging.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-source-plugin -->
<plugin.maven.source.ver>3.3.1</plugin.maven.source.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
<plugin.maven.javadoc.ver>3.7.0</plugin.maven.javadoc.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
<plugin.maven.gpg.ver>3.2.4</plugin.maven.gpg.ver>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-release-plugin -->
<plugin.maven.release.ver>3.1.0</plugin.maven.release.ver>
</properties>
<dependencyManagement>
@ -67,7 +76,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.3.1</version>
<version>${postgresql.ver}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
@ -76,13 +85,26 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>20.1.0</version>
<version>${jetbrains.annotations.ver}</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${plugin.maven.release.ver}</version>
<configuration>
<preparationGoals>clean install</preparationGoals>
<tagNameFormat>v.@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
<signTag>true</signTag>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
@ -94,15 +116,6 @@
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.maven.compiler.ver}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@ -156,6 +169,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -176,6 +193,11 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -192,22 +214,107 @@
</plugins>
</build>
</profile>
<profile>
<id>release-struchkov-nexus</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<serverId>struchkov-nexus</serverId>
<nexusUrl>https://nexus.struchkov.dev/nexus/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<serverId>struchkov-nexus</serverId>
<nexusUrl>https://nexus.struchkov.dev/nexus/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>struchkov-nexus-release</id>
<url>https://nexus.struchkov.dev/repository/maven-releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>struchkov-nexus-snapshot</id>
<url>https://nexus.struchkov.dev/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>struchkov-nexus-release</id>
<url>https://nexus.struchkov.dev/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>struchkov-nexus-snapshot</id>
<url>https://nexus.struchkov.dev/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:https://github.com/haiti-projects/haiti-filter-reactive-quarkus.git</connection>
<url>https://github.com/haiti-projects/haiti-filter-reactive-quarkus</url>
<developerConnection>scm:git:https://github.com/haiti-projects/haiti-filter-reactive-quarkus.git
</developerConnection>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<developers>
<developer>
<id>uPagge</id>

View File

@ -1,6 +1,6 @@
package dev.struchkov.haiti.filter.quarkus;
import dev.struchkov.haiti.utils.Assert;
import dev.struchkov.haiti.utils.Inspector;
import java.util.List;
@ -45,7 +45,7 @@ public class FilterResult<T> {
Integer elements,
List<T> content
) {
Assert.isNotNull(totalElements, elements, content);
Inspector.isNotNull(totalElements, elements, content);
return new FilterResult.Builder<>(totalElements, elements, content);
}

View File

@ -7,17 +7,20 @@ import dev.struchkov.haiti.filter.jooq.page.PageableOffset;
import dev.struchkov.haiti.filter.jooq.page.PageableSeek;
import dev.struchkov.haiti.filter.jooq.sort.SortContainer;
import dev.struchkov.haiti.filter.jooq.sort.SortType;
import dev.struchkov.haiti.utils.Assert;
import dev.struchkov.haiti.utils.Inspector;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.pgclient.PgPool;
import io.vertx.mutiny.sqlclient.Row;
import org.jooq.DSLContext;
import org.jooq.Query;
import org.jooq.conf.ParamType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
@ -64,7 +67,7 @@ public class QuarkusFilter<ID> {
}
public QuarkusFilter<ID> join(JoinTable... joinTables) {
Assert.isNotNull(joinTables);
Inspector.isNotNull(joinTables);
jooqFilter.join(joinTables);
return this;
}
@ -104,18 +107,25 @@ public class QuarkusFilter<ID> {
return this;
}
public Uni<List<ID>> build(Class<ID> idType, String idField) {
final Query query = jooqFilter.generateQuery(tableName + "." + idField);
public Uni<List<ID>> build(Function<Row, ID> mapper, String... idFields) {
final Query query = jooqFilter.generateQuery(Arrays.stream(idFields).map(field -> tableName + "." + field).toArray(String[]::new));
final String sql = query.getSQL();
return pgPool.preparedQuery(sql)
.execute()
.map(rows ->
StreamSupport.stream(rows.spliterator(), false)
.map(row -> row.get(idType, idField))
.map(mapper)
.collect(Collectors.toList())
);
}
public Uni<List<ID>> build(Class<ID> idType, String idField) {
return build(
row -> row.get(idType, idField),
idField
);
}
public Uni<Long> count() {
final Query query = jooqFilter.generateCount();
final String sql = query.getSQL();
@ -134,12 +144,14 @@ public class QuarkusFilter<ID> {
});
}
public Uni<FilterResult<ID>> filterResult(Class<ID> idType, String idField) {
jooqFilter.groupBy(tableName + "." + idField);
public Uni<FilterResult<ID>> filterResult(Function<Row, ID> mapper, String... idFields) {
for (String idField : idFields) {
jooqFilter.groupBy(tableName + "." + idField);
}
jooqFilter.groupBy(sortFieldNames);
distinctCount = true;
final Uni<Long> count = count();
final Uni<List<ID>> content = build(idType, idField);
final Uni<List<ID>> content = build(mapper, idFields);
return Uni.combine().all()
.unis(count, content)
.asTuple()
@ -157,4 +169,11 @@ public class QuarkusFilter<ID> {
);
}
public Uni<FilterResult<ID>> filterResult(Class<ID> idType, String idField) {
return filterResult(
row -> row.get(idType, idField),
idField
);
}
}