Package io.micronaut.starter.api.preview
Class PreviewController
java.lang.Object
io.micronaut.starter.api.create.AbstractCreateController
io.micronaut.starter.api.preview.PreviewController
- All Implemented Interfaces:
PreviewOperations
@Controller("/preview")
public class PreviewController
extends AbstractCreateController
implements PreviewOperations
Previews an application contents.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Field Summary
Fields inherited from class io.micronaut.starter.api.create.AbstractCreateController
projectGenerator
-
Constructor Summary
ConstructorDescriptionPreviewController
(ProjectGenerator projectGenerator, io.micronaut.context.event.ApplicationEventPublisher eventPublisher) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionpreviewApp
(ApplicationType type, String name, @Nullable List<String> features, @Nullable BuildTool build, @Nullable TestFramework test, @Nullable Language lang, @Nullable JdkVersion javaVersion, RequestInfo requestInfo) Previews the contents of a generated application..Methods inherited from class io.micronaut.starter.api.create.AbstractCreateController
createProjectGeneratorContext, getOperatingSystem
-
Constructor Details
-
PreviewController
public PreviewController(ProjectGenerator projectGenerator, io.micronaut.context.event.ApplicationEventPublisher eventPublisher) Default constructor.- Parameters:
projectGenerator
- The project generatoreventPublisher
- The event publisher
-
-
Method Details
-
previewApp
@Get(uri="/{type}/{name}{?features,lang,build,test,javaVersion}", produces="application/json") public PreviewDTO previewApp(ApplicationType type, String name, @Nullable @Nullable List<String> features, @Nullable @Nullable BuildTool build, @Nullable @Nullable TestFramework test, @Nullable @Nullable Language lang, @Nullable @Nullable JdkVersion javaVersion, RequestInfo requestInfo) throws IOException Previews the contents of a generated application..- Specified by:
previewApp
in interfacePreviewOperations
- Parameters:
type
- The application type The application typename
- The name of the application The name of the applicationfeatures
- The features The chosen featuresbuild
- The build type (optional, defaults to Gradle)test
- The test framework (optional, defaults to JUnit)lang
- The language (optional, defaults to Java)javaVersion
- The jdk version (optional, defaults toMicronautJdkVersionConfiguration.DEFAULT_OPTION
)requestInfo
- The request info- Returns:
- A preview of the application contents.
- Throws:
IOException
-