
entry-point.rest-mvc.api.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.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}}
@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 String commandName() {
// return useCase.doAction();
return "Hello World";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy