Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

jobs:
build:
uses: valitydev/java-workflow/.github/workflows/maven-service-build.yml@v3
uses: valitydev/java-workflow/.github/workflows/maven-service-build.yml@v4
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

jobs:
build-and-deploy:
uses: valitydev/java-workflow/.github/workflows/maven-service-deploy.yml@v3
uses: valitydev/java-workflow/.github/workflows/maven-service-deploy.yml@v4
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
53 changes: 44 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.vality</groupId>
<artifactId>service-parent-pom</artifactId>
<version>3.1.11</version>
<version>4.0.1</version>
</parent>

<artifactId>daway</artifactId>
Expand Down Expand Up @@ -49,7 +49,7 @@
<!--spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
Expand All @@ -59,6 +59,14 @@
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</exclusion>
<exclusion>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -70,13 +78,17 @@
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-flyway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Expand All @@ -102,10 +114,10 @@
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.4</version>
<version>9.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
Expand Down Expand Up @@ -152,7 +164,6 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
</dependency>

<!--dev.vality-->
Expand All @@ -177,7 +188,7 @@
<dependency>
<groupId>dev.vality</groupId>
<artifactId>damsel</artifactId>
<version>1.701-6e28041</version>
<version>1.703-8d6174b</version>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
Expand Down Expand Up @@ -214,10 +225,14 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jooq-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -230,6 +245,12 @@
<artifactId>testcontainers-annotations</artifactId>
<version>4.1.3</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand All @@ -248,6 +269,7 @@
<filtering>true</filtering>
<excludes>
<exclude>Dockerfile</exclude>
<exclude>opentelemetry-javaagent.jar</exclude>
</excludes>
</resource>
<resource>
Expand Down Expand Up @@ -399,6 +421,19 @@
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/vality/daway/DawayApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.server.servlet.context.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/vality/daway/config/KafkaConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
import org.springframework.boot.kafka.autoconfigure.KafkaProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import dev.vality.daway.exception.DaoException;
import dev.vality.mapper.RecordRowMapper;
import org.jooq.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;
Expand All @@ -18,11 +18,11 @@
import static dev.vality.daway.domain.tables.DepositAdjustment.DEPOSIT_ADJUSTMENT;

@Component
@DependsOnDatabaseInitialization

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а эти аннотации необходимы?

Вроде как она нужна в том случае, если при инициализации класса происходит магия с коннектом к БД . Если типичный репозиторий, то необязательно.

я просто интересуюсь

public class DepositAdjustmentDaoImpl extends AbstractGenericDao implements DepositAdjustmentDao {

private final RowMapper<DepositAdjustment> depositRowMapper;

@Autowired
public DepositAdjustmentDaoImpl(DataSource dataSource) {
super(dataSource);
depositRowMapper = new RecordRowMapper<>(DEPOSIT_ADJUSTMENT, DepositAdjustment.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import dev.vality.daway.exception.NotFoundException;
import dev.vality.mapper.RecordRowMapper;
import org.jooq.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;
Expand All @@ -19,11 +19,11 @@
import static dev.vality.daway.domain.tables.Deposit.DEPOSIT;

@Component
@DependsOnDatabaseInitialization
public class DepositDaoImpl extends AbstractGenericDao implements DepositDao {

private final RowMapper<Deposit> depositRowMapper;

@Autowired
public DepositDaoImpl(DataSource dataSource) {
super(dataSource);
depositRowMapper = new RecordRowMapper<>(DEPOSIT, Deposit.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import dev.vality.daway.exception.DaoException;
import dev.vality.mapper.RecordRowMapper;
import org.jooq.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;
Expand All @@ -18,11 +18,11 @@
import static dev.vality.daway.domain.tables.DepositRevert.DEPOSIT_REVERT;

@Component
@DependsOnDatabaseInitialization
public class DepositRevertDaoImpl extends AbstractGenericDao implements DepositRevertDao {

private final RowMapper<DepositRevert> depositRowMapper;

@Autowired
public DepositRevertDaoImpl(DataSource dataSource) {
super(dataSource);
depositRowMapper = new RecordRowMapper<>(DEPOSIT_REVERT, DepositRevert.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import dev.vality.daway.exception.NotFoundException;
import dev.vality.mapper.RecordRowMapper;
import org.jooq.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;
Expand All @@ -19,11 +19,11 @@
import static dev.vality.daway.domain.tables.Destination.DESTINATION;

@Component
@DependsOnDatabaseInitialization
public class DestinationDaoImpl extends AbstractGenericDao implements DestinationDao {

private final RowMapper<Destination> destinationRowMapper;

@Autowired
public DestinationDaoImpl(DataSource dataSource) {
super(dataSource);
destinationRowMapper = new RecordRowMapper<>(DESTINATION, Destination.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import dev.vality.daway.domain.tables.records.CategoryRecord;
import dev.vality.daway.exception.DaoException;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class CategoryDaoImpl extends AbstractGenericDao implements DomainObjectDao<Category, Integer> {

public CategoryDaoImpl(DataSource dataSource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import dev.vality.daway.domain.tables.records.CurrencyRecord;
import dev.vality.daway.exception.DaoException;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class CurrencyDaoImpl extends AbstractGenericDao implements DomainObjectDao<Currency, String> {

public CurrencyDaoImpl(DataSource dataSource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import dev.vality.mapper.RecordRowMapper;
import lombok.extern.slf4j.Slf4j;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;
Expand All @@ -20,6 +21,7 @@

@Slf4j
@Component
@DependsOnDatabaseInitialization
public class PartyDaoImpl extends AbstractGenericDao implements DomainObjectDao<Party, String> {

private final RowMapper<Party> rowMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import dev.vality.daway.domain.tables.records.PaymentInstitutionRecord;
import dev.vality.daway.exception.DaoException;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class PaymentInstitutionDaoImpl extends AbstractGenericDao
implements DomainObjectDao<PaymentInstitution, Integer> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import dev.vality.daway.domain.tables.records.PaymentRoutingRuleRecord;
import dev.vality.daway.exception.DaoException;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;

import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class PaymentRoutingRulesDaoImpl extends AbstractGenericDao
implements DomainObjectDao<PaymentRoutingRule, Integer> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import dev.vality.daway.domain.tables.records.ProviderRecord;
import dev.vality.daway.exception.DaoException;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class ProviderDaoImpl extends AbstractGenericDao implements DomainObjectDao<Provider, Integer> {

public ProviderDaoImpl(DataSource dataSource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
import dev.vality.daway.domain.tables.records.ProxyRecord;
import dev.vality.daway.exception.DaoException;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class ProxyDaoImpl extends AbstractGenericDao implements DomainObjectDao<Proxy, Integer> {

public ProxyDaoImpl(DataSource dataSource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import dev.vality.mapper.RecordRowMapper;
import lombok.extern.slf4j.Slf4j;
import org.jooq.Query;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.stereotype.Component;
Expand All @@ -20,6 +21,7 @@

@Slf4j
@Component
@DependsOnDatabaseInitialization
public class ShopDaoImpl extends AbstractGenericDao implements DomainObjectDao<Shop, String> {

private final RowMapper<Shop> rowMapper;
Expand Down
Loading
Loading