Skip to content

Commit

Permalink
chore: #101 Module setup
Browse files Browse the repository at this point in the history
  • Loading branch information
satran004 committed Sep 28, 2023
1 parent 501b488 commit d99d7a3
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 0 deletions.
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ include 'stores:assets'
include 'stores:protocolparams'
include 'stores:staking'
include 'stores:mir'
include 'stores:adapot'
include 'stores:live'

include 'aggregates:account'
Expand All @@ -45,4 +46,5 @@ include ':starters:live-spring-boot-starter'
include ':starters:submit-spring-boot-starter'
include ':starters:remote-spring-boot-starter'
include ':starters:account-spring-boot-starter'
include ':starters:adapot-spring-boot-starter'

21 changes: 21 additions & 0 deletions starters/adapot-spring-boot-starter/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
api project(":stores:adapot")

annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
}

tasks.named('compileJava') {
inputs.files(tasks.named('processResources'))
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'Yaci AdaPot Store Spring Boot Starter'
description = 'Yaci AdaPot Store Spring Boot Starter'
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.bloxbean.cardano.yaci.store.starter.adapot;

import com.bloxbean.cardano.yaci.store.adapot.AdaPotStoreConfiguration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Import;

@AutoConfiguration
@EnableConfigurationProperties(AdaPotStoreProperties.class)
@Import(AdaPotStoreConfiguration.class)
@Slf4j
public class AdaPotStoreAutoConfiguration {

@Autowired
AdaPotStoreProperties properties;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.bloxbean.cardano.yaci.store.starter.adapot;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Getter
@Setter
@ConfigurationProperties(prefix = "store", ignoreUnknownFields = true)
public class AdaPotStoreProperties {
private AdaPot adaPot;

@Getter
@Setter
public static final class AdaPot {
private boolean enabled = true;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.bloxbean.cardano.yaci.store.starter.adaport.AdaPotStoreAutoConfiguration
17 changes: 17 additions & 0 deletions stores/adapot/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dependencies {
api project(":components:common")
api project(":components:events")

implementation 'org.springframework.boot:spring-boot-starter-web'
}

publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'Yaci Store AdaPot Module'
description = 'Yaci Store AdaPot Module'
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.bloxbean.cardano.yaci.store.adapot;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@ConditionalOnProperty(
prefix = "store.adapot",
name = "enabled",
havingValue = "true",
matchIfMissing = true
)
@ComponentScan(basePackages = {"com.bloxbean.cardano.yaci.store.adapot"})
@EnableJpaRepositories( basePackages = {"com.bloxbean.cardano.yaci.store.adapot"})
@EntityScan(basePackages = {"com.bloxbean.cardano.yaci.store.adapot"})
@EnableTransactionManagement
public class AdaPotStoreConfiguration {
}
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit d99d7a3

Please sign in to comment.