这是indexloc提供的服务,不要输入任何密码
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
24 changes: 12 additions & 12 deletions docs/docs/tasks/5-generate-entry-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Whether you'll use generic one also parameter `name` is required.
gradle gep --type [entryPointType]
```

| Reference for **entryPointType** | Name | Additional Options |
|----------------------------------|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| generic | Empty Entry Point | --name [name] |
| asynceventhandler | Async Event Handler | --eda [true-false] --tech [rabbitmq-kafka-rabbitmq,kafka] Default: rabbitmq |
| graphql | API GraphQL | --pathgql [name path] default /graphql |
| kafka | Kafka Consumer | |
| mq | JMS MQ Client to listen messages | |
| restmvc | API REST (Spring Boot Starter Web) | --server [serverOption] default undertow --authorization [true,false] --from-swagger swagger.yaml |
| rsocket | Rsocket Controller Entry Point | |
| sqs | SQS Listener | |
| webflux | API REST (Spring Boot Starter WebFlux) | --router [true, false] default true --authorization [true,false] --from-swagger swagger.yaml --versioning [HEADER, PATH,NONE] default NONE |
| kafkastrimzi | Kafka Strimzi Consumer Entry Point | --name [name] --topicConsumer [topicName] (optional, for default 'test-with-registries') |
| Reference for **entryPointType** | Name | Additional Options |
|----------------------------------|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| generic | Empty Entry Point | --name [name] |
| asynceventhandler | Async Event Handler | --eda [true-false] --tech [rabbitmq-kafka-rabbitmq,kafka] Default: rabbitmq |
| graphql | API GraphQL | --pathgql [name path] default /graphql |
| kafka | Kafka Consumer | |
| mq | JMS MQ Client to listen messages | |
| restmvc | API REST (Spring Boot Starter Web) | --server [serverOption] default undertow --authorization [true,false] --from-swagger swagger.yaml --swagger [true,false] |
| rsocket | Rsocket Controller Entry Point | |
| sqs | SQS Listener | |
| webflux | API REST (Spring Boot Starter WebFlux) | --router [true, false] default true --authorization [true,false] --from-swagger swagger.yaml --versioning [HEADER, PATH,NONE] default NONE --swagger [true,false] |
| kafkastrimzi | Kafka Strimzi Consumer Entry Point | --name [name] --topicConsumer [topicName] (optional, for default 'test-with-registries') |

Additionally, if you'll use a restmvc, you can specify the web server on which the application will run. By default,
undertow.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/com/bancolombia/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class Constants {
public static final String OKHTTP_VERSION = "5.1.0";
public static final String RESILIENCE_4J_VERSION = "2.3.0";
public static final String BIN_STASH_VERSION = "1.3.2";
public static final String SPRING_DOC_OPENAPI_VERSION = "2.8.13";
public static final String SPRING_DOC_OPENAPI_VERSION = "2.8.14";
public static final String CLOUD_EVENTS_VERSION = "4.0.1";
// gradle plugins
public static final String JACOCO_VERSION = "0.8.13";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ public void buildModule(ModuleBuilder builder) throws IOException, CleanExceptio

if (Boolean.TRUE.equals(builder.getBooleanParam("include-swagger"))) {
builder.addParam("module", "api-rest");
builder.setupFromTemplate("entry-point/swagger");
builder
.appendToProperties("springdoc")
.put("swagger-ui.path", "/v3/swagger-ui.html")
.put("api-docs.path", "/v3/api-docs")
.put("show-actuator", true);
}
if (builder.withMetrics()) {
builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ public void buildModule(ModuleBuilder builder) throws IOException, CleanExceptio
builder.runValidations(ReactiveTypeValidation.class);
if (Boolean.TRUE.equals(builder.getBooleanParam("task-param-router"))) {
setupTemplate(builder, versioningStrategy);

} else {
builder.setupFromTemplate("entry-point/rest-webflux");
// to run archunit validations
builder.appendDependencyToModule(
APP_SERVICE, buildTestImplementation("org.springframework:spring-web"));
if (Boolean.TRUE.equals(builder.getBooleanParam("include-swagger"))) {
builder.addParam("module", "reactive-web");
builder.setupFromTemplate("entry-point/swagger");
}
}
if (Boolean.TRUE.equals(builder.getBooleanParam("include-swagger"))) {
builder.addParam("module", "reactive-web");
builder
.appendToProperties("springdoc")
.put("swagger-ui.path", "/v3/swagger-ui.html")
.put("api-docs.path", "/v3/api-docs")
.put("show-actuator", true);
}

if (Boolean.TRUE.equals(builder.getBooleanParam("task-param-authorize"))) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package {{package}}.api;

{{#include-swagger}}
import org.springdoc.core.annotations.RouterOperation;
import org.springdoc.core.annotations.RouterOperations;
{{/include-swagger}}
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
Expand All @@ -11,6 +15,11 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r

@Configuration
public class RouterRest {
{{#include-swagger}}
@RouterOperations({ @RouterOperation(path = "/api/usecase/path", beanClass = Handler.class, beanMethod = "listenGETUseCase"),
@RouterOperation(path = "/api/usecase/otherpath", beanClass = Handler.class, beanMethod = "listenPOSTUseCase"),
@RouterOperation(path = "/api/otherusercase/path", beanClass = Handler.class, beanMethod = "listenGETOtherUseCase") })
{{/include-swagger}}
@Bean
public RouterFunction<ServerResponse> routerFunction(Handler handler) {
return route(GET("/api/usecase/path"), handler::listenGETUseCase)
Expand Down
7 changes: 0 additions & 7 deletions src/main/resources/entry-point/swagger/definition.json

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ void generateEntryPointApiRestWithDefaultServerAndSwagger() throws IOException,
TEST_DIR + "/infrastructure/entry-points/api-rest/",
"build.gradle",
"src/main/java/co/com/bancolombia/api/ApiRest.java",
"src/test/java/co/com/bancolombia/api",
"src/main/java/co/com/bancolombia/config/SpringFoxConfig.java");
"src/test/java/co/com/bancolombia/api");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ void generateEntryPointReactiveWebWithoutRouterFunctionsAndSwagger()
TEST_DIR + "/infrastructure/entry-points/reactive-web",
"build.gradle",
"src/main/java/co/com/bancolombia/api/ApiRest.java",
"src/test/java/co/com/bancolombia/api/ApiRestTest.java",
"src/main/java/co/com/bancolombia/config/SpringFoxConfig.java");
"src/test/java/co/com/bancolombia/api/ApiRestTest.java");
}

@Test
Expand Down