
entry-point.rest-webflux.router-functions.handler.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.api;
{{#lombok}}
import lombok.RequiredArgsConstructor;
{{/lombok}}
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
{{#task-param-authorize}}
import org.springframework.security.access.prepost.PreAuthorize;
{{/task-param-authorize}}
import reactor.core.publisher.Mono;
@Component
{{#lombok}}
@RequiredArgsConstructor
{{/lombok}}
public class Handler {
//private final UseCase useCase;
//private final UseCase2 useCase2;
{{^lombok}}
public Handler() {
}
{{/lombok}}
{{#task-param-authorize}}
@PreAuthorize("hasRole('permissionGET')")
{{/task-param-authorize}}
public Mono listenGETUseCase(ServerRequest serverRequest) {
// usecase.logic();
return ServerResponse.ok().bodyValue("");
}
{{#task-param-authorize}}
@PreAuthorize("hasRole('permissionGETOther')")
{{/task-param-authorize}}
public Mono listenGETOtherUseCase(ServerRequest serverRequest) {
// useCase2.logic();
return ServerResponse.ok().bodyValue("");
}
{{#task-param-authorize}}
@PreAuthorize("hasRole('permissionPOST')")
{{/task-param-authorize}}
public Mono listenPOSTUseCase(ServerRequest serverRequest) {
// usecase.logic();
return ServerResponse.ok().bodyValue("");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy