Skip to content

Commit

Permalink
Merge pull request #91 from cardano-foundation/refactor/MET-1897-redu…
Browse files Browse the repository at this point in the history
…ce-the-amount-of-common-repository

refactor: remove common repository
  • Loading branch information
Sotatek-DucPhung authored Feb 15, 2024
2 parents e558f0c + 239c33b commit a48f096
Show file tree
Hide file tree
Showing 52 changed files with 116 additions and 178 deletions.
14 changes: 3 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
<version.lombok>1.18.26</version.lombok>
<org.projectlombok.version>1.18.24</org.projectlombok.version>
<koios-java-client.version>1.18.1</koios-java-client.version>
<version.ledgersync-common>0.1.0-SNAPSHOT</version.ledgersync-common>
<version.explorer-common>0.1.1-SNAPSHOT</version.explorer-common>
<version.explorer-consumer-common>0.1.12</version.explorer-consumer-common>
<version.explorer-common>0.1.16-SNAPSHOT-PR173</version.explorer-common>
<version.spring-boot>3.0.5</version.spring-boot>
<version.flyway>9.16.0</version.flyway>
<version.maven-compiler-plugin>3.10.0</version.maven-compiler-plugin>
Expand Down Expand Up @@ -61,16 +59,10 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.cardanofoundation.ledgersync</groupId>
<artifactId>common</artifactId>
<version>${version.ledgersync-common}</version>
</dependency>

<dependency>
<groupId>org.cardanofoundation.explorer</groupId>
<artifactId>consumer-common</artifactId>
<version>${version.explorer-consumer-common}</version>
<artifactId>common</artifactId>
<version>${version.explorer-common}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import org.cardanofoundation.explorer.consumercommon.entity.Epoch;
import org.cardanofoundation.explorer.common.entity.ledgersync.Epoch;
import org.cardanofoundation.explorer.rewards.service.EpochFetchingService;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import org.cardanofoundation.explorer.consumercommon.entity.Epoch;
import org.cardanofoundation.explorer.common.entity.ledgersync.Epoch;
import org.cardanofoundation.explorer.rewards.concurrent.EpochConcurrentFetching;

@RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;

import org.cardanofoundation.explorer.consumercommon.entity.AdaPots;
import org.cardanofoundation.explorer.common.entity.ledgersync.AdaPots;

public interface AdaPotsRepository extends JpaRepository<AdaPots, Integer> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import org.cardanofoundation.explorer.consumercommon.entity.Block;
import org.cardanofoundation.explorer.common.entity.ledgersync.Block;

public interface BlockRepository extends JpaRepository<Block, Long> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.Epoch;
import org.cardanofoundation.explorer.common.entity.ledgersync.Epoch;

@Repository
public interface EpochRepository extends JpaRepository<Epoch, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.EpochStakeCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStakeCheckpoint;

@Repository
public interface EpochStakeCheckpointRepository extends JpaRepository<EpochStakeCheckpoint, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.EpochStake;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStake;

@Repository
public interface EpochStakeRepository extends JpaRepository<EpochStake, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHash;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;

@Repository
public interface PoolHashRepository extends JpaRepository<PoolHash, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHistoryCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistoryCheckpoint;

@Repository
public interface PoolHistoryCheckpointRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHistory;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistory;

@Repository
public interface PoolHistoryRepository extends JpaRepository<PoolHistory, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.PoolInfoCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfoCheckpoint;

@Repository
public interface PoolInfoCheckpointRepository extends JpaRepository<PoolInfoCheckpoint, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.PoolInfo;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfo;

@Repository
public interface PoolInfoRepository extends JpaRepository<PoolInfo, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.RewardCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.RewardCheckpoint;

@Repository
public interface RewardCheckpointRepository extends JpaRepository<RewardCheckpoint, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.Reward;
import org.cardanofoundation.explorer.common.entity.ledgersync.Reward;

@Repository
public interface RewardRepository extends JpaRepository<Reward, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import org.cardanofoundation.explorer.consumercommon.entity.StakeAddress;
import org.cardanofoundation.explorer.common.entity.ledgersync.StakeAddress;

@Repository
public interface StakeAddressRepository extends JpaRepository<StakeAddress, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.EpochStakeCheckpoint;
import org.cardanofoundation.explorer.consumercommon.entity.EpochStakeCheckpoint_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStakeCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStakeCheckpoint_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQEpochStakeCheckpointRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.EpochStake;
import org.cardanofoundation.explorer.consumercommon.entity.EpochStake_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStake;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStake_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQEpochStakeRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHistoryCheckpoint;
import org.cardanofoundation.explorer.consumercommon.entity.PoolHistoryCheckpoint_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistoryCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistoryCheckpoint_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQPoolHistoryCheckpointRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHistory;
import org.cardanofoundation.explorer.consumercommon.entity.PoolHistory_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistory;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistory_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQPoolHistoryRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.PoolInfoCheckpoint;
import org.cardanofoundation.explorer.consumercommon.entity.PoolInfoCheckpoint_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfoCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfoCheckpoint_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQPoolInfoCheckpointRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.PoolInfo;
import org.cardanofoundation.explorer.consumercommon.entity.PoolInfo_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfo;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfo_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQPoolInfoRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.RewardCheckpoint;
import org.cardanofoundation.explorer.consumercommon.entity.RewardCheckpoint_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.RewardCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.RewardCheckpoint_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Component
public class JOOQRewardCheckpointRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import org.jooq.DSLContext;
import org.jooq.Query;

import org.cardanofoundation.explorer.consumercommon.entity.Reward;
import org.cardanofoundation.explorer.consumercommon.entity.Reward_;
import org.cardanofoundation.explorer.rewards.util.EntityUtil;
import org.cardanofoundation.explorer.common.entity.ledgersync.Reward;
import org.cardanofoundation.explorer.common.entity.ledgersync.Reward_;
import org.cardanofoundation.explorer.common.utils.EntityUtil;

@Repository
public class JOOQRewardRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHash;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;
import org.cardanofoundation.explorer.rewards.repository.PoolHashRepository;
import org.cardanofoundation.explorer.rewards.schedule.service.PoolInfoDataService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import io.micrometer.common.util.StringUtils;
import rest.koios.client.backend.api.base.exception.ApiException;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHash;
import org.cardanofoundation.explorer.consumercommon.entity.PoolInfo;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfo;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.PoolHashRepository;
import org.cardanofoundation.explorer.rewards.repository.jooq.JOOQPoolInfoRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import java.util.concurrent.CompletableFuture;

import org.cardanofoundation.explorer.consumercommon.entity.Epoch;
import org.cardanofoundation.explorer.common.entity.ledgersync.Epoch;

public interface EpochFetchingService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import rest.koios.client.backend.api.network.model.Totals;

import org.cardanofoundation.explorer.consumercommon.entity.AdaPots;
import org.cardanofoundation.explorer.consumercommon.entity.Block;
import org.cardanofoundation.explorer.common.entity.ledgersync.AdaPots;
import org.cardanofoundation.explorer.common.entity.ledgersync.Block;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.AdaPotsRepository;
import org.cardanofoundation.explorer.rewards.repository.BlockRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import io.micrometer.common.util.StringUtils;

import org.cardanofoundation.explorer.consumercommon.entity.Epoch;
import org.cardanofoundation.explorer.consumercommon.enumeration.EraType;
import org.cardanofoundation.explorer.common.entity.enumeration.EraType;
import org.cardanofoundation.explorer.common.entity.ledgersync.Epoch;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.EpochRepository;
import org.cardanofoundation.explorer.rewards.service.EpochFetchingService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import rest.koios.client.backend.api.account.model.AccountHistoryInner;
import rest.koios.client.backend.api.base.exception.ApiException;

import org.cardanofoundation.explorer.consumercommon.entity.EpochStake;
import org.cardanofoundation.explorer.consumercommon.entity.EpochStakeCheckpoint;
import org.cardanofoundation.explorer.consumercommon.entity.PoolHash;
import org.cardanofoundation.explorer.consumercommon.entity.StakeAddress;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStake;
import org.cardanofoundation.explorer.common.entity.ledgersync.EpochStakeCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;
import org.cardanofoundation.explorer.common.entity.ledgersync.StakeAddress;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.EpochStakeCheckpointRepository;
import org.cardanofoundation.explorer.rewards.repository.PoolHashRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import io.micrometer.common.util.StringUtils;
import rest.koios.client.backend.api.base.exception.ApiException;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHistory;
import org.cardanofoundation.explorer.consumercommon.entity.PoolHistoryCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistory;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHistoryCheckpoint;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.PoolHashRepository;
import org.cardanofoundation.explorer.rewards.repository.PoolHistoryCheckpointRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import io.micrometer.common.util.StringUtils;
import rest.koios.client.backend.api.base.exception.ApiException;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHash;
import org.cardanofoundation.explorer.consumercommon.entity.PoolInfo;
import org.cardanofoundation.explorer.consumercommon.entity.PoolInfoCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfo;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolInfoCheckpoint;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.PoolHashRepository;
import org.cardanofoundation.explorer.rewards.repository.jooq.JOOQPoolInfoCheckpointRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import rest.koios.client.backend.api.account.model.AccountRewards;
import rest.koios.client.backend.api.base.exception.ApiException;

import org.cardanofoundation.explorer.consumercommon.entity.PoolHash;
import org.cardanofoundation.explorer.consumercommon.entity.Reward;
import org.cardanofoundation.explorer.consumercommon.entity.RewardCheckpoint;
import org.cardanofoundation.explorer.consumercommon.entity.StakeAddress;
import org.cardanofoundation.explorer.consumercommon.enumeration.RewardType;
import org.cardanofoundation.explorer.common.entity.enumeration.RewardType;
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;
import org.cardanofoundation.explorer.common.entity.ledgersync.Reward;
import org.cardanofoundation.explorer.common.entity.ledgersync.RewardCheckpoint;
import org.cardanofoundation.explorer.common.entity.ledgersync.StakeAddress;
import org.cardanofoundation.explorer.rewards.config.KoiosClient;
import org.cardanofoundation.explorer.rewards.repository.PoolHashRepository;
import org.cardanofoundation.explorer.rewards.repository.RewardCheckpointRepository;
Expand Down
Loading

0 comments on commit a48f096

Please sign in to comment.