refactored
This commit is contained in:
parent
3d31a3866f
commit
f9ed4561f9
56
.gitignore
vendored
56
.gitignore
vendored
@ -1,55 +1,7 @@
|
|||||||
# These are some examples of commonly ignored file patterns.
|
# Maven
|
||||||
# You should customize this list as applicable to your project.
|
target
|
||||||
# Learn more about .gitignore:
|
|
||||||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
|
||||||
|
|
||||||
# Node artifact files
|
# Eclipse
|
||||||
node_modules/
|
|
||||||
dist/
|
|
||||||
|
|
||||||
# Eclipse files
|
|
||||||
.settings
|
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
|
.settings
|
||||||
# Compiled Java class files
|
|
||||||
*.class
|
|
||||||
|
|
||||||
# Compiled Python bytecode
|
|
||||||
*.py[cod]
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Package files
|
|
||||||
*.jar
|
|
||||||
|
|
||||||
# Maven
|
|
||||||
target/
|
|
||||||
dist/
|
|
||||||
|
|
||||||
# JetBrains IDE
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# Unit test reports
|
|
||||||
TEST*.xml
|
|
||||||
|
|
||||||
# Generated by MacOS
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Generated by Windows
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Applications
|
|
||||||
*.app
|
|
||||||
*.exe
|
|
||||||
*.war
|
|
||||||
|
|
||||||
# Large media files
|
|
||||||
*.mp4
|
|
||||||
*.tiff
|
|
||||||
*.avi
|
|
||||||
*.flv
|
|
||||||
*.mov
|
|
||||||
*.wmv
|
|
||||||
|
|
||||||
|
55
pom.xml
55
pom.xml
@ -22,51 +22,21 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.poststats</groupId>
|
<groupId>com.poststats</groupId>
|
||||||
<artifactId>poststats-core</artifactId>
|
<artifactId>commons-rs-api</artifactId>
|
||||||
<version>2.0-SNAPSHOT</version>
|
<version>2.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- adds JAX-RS support (REST services) -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.ws.rs</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>4.5.14</version>
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- adds Servlet support -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>jakarta.servlet</groupId>
|
|
||||||
<artifactId>jakarta.servlet-api</artifactId>
|
|
||||||
<version>6.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- adds CDI support -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>jakarta.enterprise</groupId>
|
|
||||||
<artifactId>jakarta.enterprise.cdi-api</artifactId>
|
|
||||||
<version>4.0.1</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>org.telegram</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>telegrambots-meta</artifactId>
|
||||||
<version>2.0.1</version>
|
<version>6.4.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- adds EJB support -->
|
<!-- adds multi-part and cache support -->
|
||||||
<dependency>
|
|
||||||
<groupId>jakarta.ejb</groupId>
|
|
||||||
<artifactId>jakarta.ejb-api</artifactId>
|
|
||||||
<version>4.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- adds JavaTime support for JSON (de)serialization -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
|
||||||
<version>2.13.4</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- adds multi-part support -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>resteasy-multipart-provider</artifactId>
|
<artifactId>resteasy-multipart-provider</artifactId>
|
||||||
@ -79,12 +49,7 @@
|
|||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<!-- for unit testing -->
|
||||||
<groupId>org.telegram</groupId>
|
|
||||||
<artifactId>telegrambots-meta</artifactId>
|
|
||||||
<version>6.4.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
@ -112,7 +77,7 @@
|
|||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<resourcePackages>
|
<resourcePackages>
|
||||||
<resourcePackage>com.poststats.api</resourcePackage>
|
<resourcePackage>com.poststats.rs.api</resourcePackage>
|
||||||
</resourcePackages>
|
</resourcePackages>
|
||||||
<outputPath>${project.build.outputDirectory}/META-INF</outputPath>
|
<outputPath>${project.build.outputDirectory}/META-INF</outputPath>
|
||||||
<outputFileName>poststats-swagger</outputFileName>
|
<outputFileName>poststats-swagger</outputFileName>
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
package com.poststats.rs.api;
|
package com.poststats.rs.api;
|
||||||
|
|
||||||
public class Constants {
|
public class Constants extends com.poststats.rs.Constants {
|
||||||
|
|
||||||
public static final String V1_JSON = "application/vnd.poststats-v1+json";
|
|
||||||
public static final String ADMIN_ROLE = "admin";
|
|
||||||
public static final String AUTH_ROLE = "auth";
|
|
||||||
public static final String MANAGER_ROLE = "owner";
|
|
||||||
public static final String MANAGER_ROLE_PREFIX = MANAGER_ROLE
|
|
||||||
+ ":";
|
|
||||||
public static final String FACILITY_ROLE_PREFIX = "facility:";
|
public static final String FACILITY_ROLE_PREFIX = "facility:";
|
||||||
|
|
||||||
public static final String PERSON_ID = "personId";
|
public static final String PERSON_ID = "personId";
|
||||||
|
@ -7,7 +7,6 @@ import io.swagger.v3.oas.annotations.Parameter;
|
|||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.enterprise.context.RequestScoped;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Positive;
|
import jakarta.validation.constraints.Positive;
|
||||||
import jakarta.ws.rs.GET;
|
import jakarta.ws.rs.GET;
|
||||||
@ -19,7 +18,6 @@ import jakarta.ws.rs.core.MediaType;
|
|||||||
/**
|
/**
|
||||||
* @author brian.long@poststats.com
|
* @author brian.long@poststats.com
|
||||||
*/
|
*/
|
||||||
@RequestScoped
|
|
||||||
@Path("/facility/{facilityId}")
|
@Path("/facility/{facilityId}")
|
||||||
@Tag(name = "Facility API")
|
@Tag(name = "Facility API")
|
||||||
@Produces({MediaType.APPLICATION_JSON, Constants.V1_JSON})
|
@Produces({MediaType.APPLICATION_JSON, Constants.V1_JSON})
|
||||||
|
@ -3,8 +3,6 @@ package com.poststats.rs.api;
|
|||||||
import org.telegram.telegrambots.meta.api.objects.Update;
|
import org.telegram.telegrambots.meta.api.objects.Update;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.Hidden;
|
import io.swagger.v3.oas.annotations.Hidden;
|
||||||
import jakarta.transaction.Transactional;
|
|
||||||
import jakarta.transaction.Transactional.TxType;
|
|
||||||
import jakarta.ws.rs.Consumes;
|
import jakarta.ws.rs.Consumes;
|
||||||
import jakarta.ws.rs.HeaderParam;
|
import jakarta.ws.rs.HeaderParam;
|
||||||
import jakarta.ws.rs.POST;
|
import jakarta.ws.rs.POST;
|
||||||
@ -17,7 +15,6 @@ public interface TelegramWebhookApi {
|
|||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Transactional(TxType.REQUIRED)
|
|
||||||
void update(@HeaderParam("X-Telegram-Bot-Api-Secret-Token") String secret, final Update update);
|
void update(@HeaderParam("X-Telegram-Bot-Api-Secret-Token") String secret, final Update update);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user