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.
|
||||
# You should customize this list as applicable to your project.
|
||||
# Learn more about .gitignore:
|
||||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
||||
# Maven
|
||||
target
|
||||
|
||||
# Node artifact files
|
||||
node_modules/
|
||||
dist/
|
||||
|
||||
# Eclipse files
|
||||
.settings
|
||||
# Eclipse
|
||||
.project
|
||||
.classpath
|
||||
|
||||
# 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
|
||||
|
||||
.settings
|
||||
|
55
pom.xml
55
pom.xml
@ -22,51 +22,21 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.poststats</groupId>
|
||||
<artifactId>poststats-core</artifactId>
|
||||
<artifactId>commons-rs-api</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- adds JAX-RS support (REST services) -->
|
||||
<dependency>
|
||||
<groupId>jakarta.ws.rs</groupId>
|
||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
||||
<version>3.1.0</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>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<groupId>org.telegram</groupId>
|
||||
<artifactId>telegrambots-meta</artifactId>
|
||||
<version>6.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- adds EJB 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 -->
|
||||
<!-- adds multi-part and cache support -->
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-multipart-provider</artifactId>
|
||||
@ -79,12 +49,7 @@
|
||||
<version>${swagger.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.telegram</groupId>
|
||||
<artifactId>telegrambots-meta</artifactId>
|
||||
<version>6.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- for unit testing -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
@ -112,7 +77,7 @@
|
||||
<version>${swagger.version}</version>
|
||||
<configuration>
|
||||
<resourcePackages>
|
||||
<resourcePackage>com.poststats.api</resourcePackage>
|
||||
<resourcePackage>com.poststats.rs.api</resourcePackage>
|
||||
</resourcePackages>
|
||||
<outputPath>${project.build.outputDirectory}/META-INF</outputPath>
|
||||
<outputFileName>poststats-swagger</outputFileName>
|
||||
|
@ -1,13 +1,7 @@
|
||||
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 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.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.enterprise.context.RequestScoped;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import jakarta.ws.rs.GET;
|
||||
@ -19,7 +18,6 @@ import jakarta.ws.rs.core.MediaType;
|
||||
/**
|
||||
* @author brian.long@poststats.com
|
||||
*/
|
||||
@RequestScoped
|
||||
@Path("/facility/{facilityId}")
|
||||
@Tag(name = "Facility API")
|
||||
@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 io.swagger.v3.oas.annotations.Hidden;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.transaction.Transactional.TxType;
|
||||
import jakarta.ws.rs.Consumes;
|
||||
import jakarta.ws.rs.HeaderParam;
|
||||
import jakarta.ws.rs.POST;
|
||||
@ -17,7 +15,6 @@ public interface TelegramWebhookApi {
|
||||
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Transactional(TxType.REQUIRED)
|
||||
void update(@HeaderParam("X-Telegram-Bot-Api-Secret-Token") String secret, final Update update);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user