#38 hexagonal: banking service - init
This commit is contained in:
34
bobby-pay/banking-service/build.gradle
Normal file
34
bobby-pay/banking-service/build.gradle
Normal file
@@ -0,0 +1,34 @@
|
||||
plugins {
|
||||
id 'com.palantir.docker' version '0.25.0'
|
||||
}
|
||||
|
||||
group 'org.example.banking'
|
||||
version '1.0.0'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'javax.persistence:javax.persistence-api:2.2'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.jetbrains:annotations:23.0.0'
|
||||
|
||||
implementation project(path: ':common')
|
||||
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
|
||||
runtimeOnly 'com.h2database:h2'
|
||||
runtimeOnly 'mysql:mysql-connector-java'
|
||||
}
|
||||
|
||||
docker {
|
||||
println(tasks.bootJar.outputs.files)
|
||||
name rootProject.name + '-' + project.name + ":" + version
|
||||
dockerfile file('../Dockerfile')
|
||||
files tasks.bootJar.outputs.files
|
||||
buildArgs(['JAR_FILE': tasks.bootJar.outputs.files.singleFile.name])
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.example.banking;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class BankingApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(BankingApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.example.banking;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public Docket restAPI() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("org.example.banking"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user