Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
6cd9512ec7 | |||
817a891a92 | |||
adc3456e07 | |||
df7666ef14 | |||
b90f9db3f2 | |||
e3675896e5 | |||
951e65b09b | |||
1dcaf689b7 | |||
28ab5f1261 | |||
d3421fe295 | |||
ff3a33d4ec | |||
005c810d7f | |||
52da77f724 | |||
aa267de51f | |||
d34e65f633 | |||
1a34ca56a8 | |||
eae367c5e6 | |||
b523315714 | |||
c3e60c5a48 | |||
a81e0cd509 | |||
e502ff7644 | |||
b27abcd32b | |||
0a29a0ab8c | |||
69496ce01c | |||
c503738e21 | |||
6dc634e511 | |||
5030542338 | |||
972ac2b3c3 | |||
98ab91fb6a | |||
3f8987875c | |||
aa7db91d40 | |||
a07e52df56 | |||
44e8dc5253 | |||
156048a348 | |||
0d0a0c7859 | |||
92d9c07f44 | |||
892c92ff04 | |||
117b575d58 | |||
e8107a3012 | |||
62f4682d81 | |||
|
2d00fd8f96 |
111
.drone.yml
Normal file
111
.drone.yml
Normal 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
19
.gitignore
vendored
@ -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
167
pom.xml
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user