Skip to content

Commit

Permalink
feat: P4ADEV-1531 refactor (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
antocalo authored Nov 27, 2024
1 parent 07bdf1d commit a242895
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ Here is a quick overview of the files and directories included in this repositor
```plaintext
.
├── .github/ # GitHub configuration files
├── openapi/ # OpenAPI specification files
├── gradle/ # Gradle wrapper files
├── helm/ # Helm charts for Kubernetes deployments
├── openapi/ # OpenAPI specification files
├── src/ # Source code for the Java application
│ ├── main/
│ └── test/
├── build.gradle.kts # Gradle build file
├── settings.gradle.kts # Gradle settings file
├── Dockerfile # Docker build file
├── README.md # Project documentation
├── settings.gradle.kts # Gradle settings file
└── .gitignore # Git ignore rules
```

Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ configure<SourceSetContainer> {
}

springBoot {
mainClass.value("it.gov.pagopa.payhub.template.payments.java.repository.PayhubApplication")
mainClass.value("it.gov.pagopa.template.TemplateApplication")
}

openApiGenerate {
generatorName.set("spring")
inputSpec.set("$rootDir/openapi/template-payments-java-repository.openapi.yaml")
outputDir.set("$projectDir/build/generated")
apiPackage.set("it.gov.pagopa.payhub.controller.generated")
modelPackage.set("it.gov.pagopa.payhub.model.generated")
apiPackage.set("it.gov.pagopa.template.controller.generated")
modelPackage.set("it.gov.pagopa.template.model.generated")
configOptions.set(mapOf(
"dateLibrary" to "java8",
"requestMappingMode" to "api_interface",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package it.gov.pagopa.template;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class PayhubApplication {
public class TemplateApplication {

public static void main(String[] args) {
SpringApplication.run(PayhubApplication.class, args);
SpringApplication.run(TemplateApplication.class, args);
}

}
35 changes: 35 additions & 0 deletions src/main/java/it/gov/pagopa/template/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package it.gov.pagopa.template.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* The Class SwaggerConfig.
*/
@Configuration
public class SwaggerConfig {

/** The title. */
@Value("${swagger.title:${spring.application.name}}")
private String title;

/** The description. */
@Value("${swagger.description:Api and Models}")
private String description;

/** The version. */
@Value("${swagger.version:${spring.application.version}}")
private String version;

@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI().components(new Components()).info(new Info()
.title(title)
.description(description)
.version(version));
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils;
package it.gov.pagopa.template.utils;

public class Calculator {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package utils;
package it.gov.pagopa.template.utils;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand Down

0 comments on commit a242895

Please sign in to comment.