Class GitHubCreateController
java.lang.Object
io.micronaut.starter.api.create.github.GitHubCreateController
- All Implemented Interfaces:
GitHubCreateOperation
@Controller
@ExecuteOn("blocking")
@Requires(beans={GitHubCreateService.class,GitHubRedirectService.class})
public class GitHubCreateController
extends Object
implements GitHubCreateOperation
GitHub create controller.
- Since:
- 2.2
- Author:
- Pavol Gressa
-
Constructor Summary
ConstructorsConstructorDescriptionGitHubCreateController(GitHubCreateService gitHubCreateService, GitHubRedirectService redirectService) -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.http.HttpResponse<GitHubCreateDTO>createApp(@NonNull ApplicationType type, @Pattern(regexp="[\\w\\d-_\\.]+") String name, @Nullable List<String> features, @Nullable BuildTool build, @Nullable TestFramework test, @Nullable Language lang, @Nullable JdkVersion javaVersion, @Nullable String code, @Nullable String state, @Nullable String userAgent, @NonNull RequestInfo requestInfo) Creates an application in GitHub repository, generating a json file as the response.io.micronaut.http.HttpResponse<String>handleCallback(@Nullable String error, @Nullable String errorDescription) Endpoint handles GitHub OAuth authorisation errors.
-
Constructor Details
-
GitHubCreateController
public GitHubCreateController(GitHubCreateService gitHubCreateService, GitHubRedirectService redirectService)
-
-
Method Details
-
createApp
@Get(uri="/github/{type}/{name}{?features,lang,build,test,javaVersion,code,state}", produces="application/json") public io.micronaut.http.HttpResponse<GitHubCreateDTO> createApp(@NonNull @NonNull ApplicationType type, @Pattern(regexp="[\\w\\d-_\\.]+") @Pattern(regexp="[\\w\\d-_\\.]+") String name, @Nullable @Nullable List<String> features, @Nullable @Nullable BuildTool build, @Nullable @Nullable TestFramework test, @Nullable @Nullable Language lang, @Nullable @Nullable JdkVersion javaVersion, @Nullable @Nullable String code, @Nullable @Nullable String state, @Nullable @Header("User-Agent") @Nullable String userAgent, @NonNull @NonNull RequestInfo requestInfo) Creates an application in GitHub repository, generating a json file as the response.- Specified by:
createAppin interfaceGitHubCreateOperation- 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 java versioncode- The github code- Returns:
- A json containing the generated application details.
-
handleCallback
@Get(uri="/github{?error,error_description}", produces="application/json") public io.micronaut.http.HttpResponse<String> handleCallback(@Nullable @Nullable String error, @Nullable @QueryValue("error_description") @Nullable String errorDescription) Endpoint handles GitHub OAuth authorisation errors.- Parameters:
error- error codeerrorDescription- description- Returns:
- Http redirects
- See Also:
-