All Downloads are FREE. Search and download functionalities are using the official Maven repository.

entry-point.rest-webflux.api.mustache Maven / Gradle / Ivy

Go to download

Gradle plugin to create a clean application in Java that already works, It follows our best practices!

There is a newer version: 3.20.10
Show newest version
package {{package}}.api;
{{#lombok}}
import lombok.AllArgsConstructor;
{{/lombok}}
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
{{#task-param-authorize}}
import org.springframework.security.access.prepost.PreAuthorize;
{{/task-param-authorize}}
import reactor.core.publisher.Mono;

@RestController
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
{{#lombok}}
@AllArgsConstructor
{{/lombok}}
public class ApiRest {
//    private final MyUseCase useCase;

{{^lombok}}
    //public ApiRest(MyUseCase useCase){
    //    this.useCase = useCase;
    //}
{{/lombok}}

{{#task-param-authorize}}
    @PreAuthorize("hasRole('permission')")
{{/task-param-authorize}}
    @GetMapping(path = "/path")
    public Mono commandName() {
//      return useCase.doAction();
        return Mono.just("Hello World");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy