-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,442 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Micronaut 2.4.0 Documentation | ||
|
||
- [User Guide](https://docs.micronaut.io/2.4.0/guide/index.html) | ||
- [API Reference](https://docs.micronaut.io/2.4.0/api/index.html) | ||
- [Configuration Reference](https://docs.micronaut.io/2.4.0/guide/configurationreference.html) | ||
- [Micronaut Guides](https://guides.micronaut.io/index.html) | ||
--- | ||
|
||
## Feature http-client documentation | ||
|
||
- [Micronaut HTTP Client documentation](https://docs.micronaut.io/latest/guide/index.html#httpClient) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2018-2021 Agorapulse. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
plugins { | ||
id("groovy") | ||
id("com.github.johnrengelman.shadow") version "6.1.0" | ||
id("io.micronaut.application") version "1.4.2" | ||
} | ||
|
||
version = "0.1" | ||
group = "heist" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
micronaut { | ||
runtime("netty") | ||
testRuntime("spock2") | ||
processing { | ||
incremental(true) | ||
annotations("heist.*") | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation("io.micronaut:micronaut-validation") | ||
implementation("io.micronaut:micronaut-runtime") | ||
implementation("io.micronaut:micronaut-http-client") | ||
runtimeOnly("ch.qos.logback:logback-classic") | ||
|
||
testImplementation project(':gru-micronaut') | ||
} | ||
|
||
|
||
application { | ||
mainClass.set("heist.Application") | ||
} | ||
java { | ||
sourceCompatibility = JavaVersion.toVersion("1.8") | ||
targetCompatibility = JavaVersion.toVersion("1.8") | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
applicationType: default | ||
defaultPackage: heist | ||
testFramework: spock | ||
sourceLanguage: java | ||
buildTool: gradle | ||
features: [app-name, gradle, http-client, java, java-application, logback, netty-server, readme, shade, spock, yaml] |
31 changes: 31 additions & 0 deletions
31
examples/heist-micronaut/src/main/java/heist/micronaut/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2018-2021 Agorapulse. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package heist.micronaut; | ||
|
||
import io.micronaut.context.ApplicationContext; | ||
import io.micronaut.runtime.Micronaut; | ||
|
||
public class Application { | ||
|
||
static ApplicationContext context; | ||
|
||
public static void main(String[] args) { | ||
context = Micronaut.run(Application.class, args); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
examples/heist-micronaut/src/main/java/heist/micronaut/DefaultMoonService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2018-2021 Agorapulse. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package heist.micronaut; | ||
|
||
import javax.inject.Singleton; | ||
|
||
@Singleton | ||
public class DefaultMoonService implements MoonService { | ||
|
||
@Override | ||
public Moon get(String planet, String name) { | ||
return new Moon(planet, name); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
examples/heist-micronaut/src/main/java/heist/micronaut/Moon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2018-2021 Agorapulse. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package heist.micronaut; | ||
|
||
import java.time.Instant; | ||
|
||
public class Moon { | ||
|
||
public Moon() { } | ||
|
||
public Moon(String name, String planet) { | ||
this.name = name; | ||
this.planet = planet; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getPlanet() { | ||
return planet; | ||
} | ||
|
||
public void setPlanet(String planet) { | ||
this.planet = planet; | ||
} | ||
|
||
public Instant getCreated() { | ||
return created; | ||
} | ||
|
||
public void setCreated(Instant created) { | ||
this.created = created; | ||
} | ||
|
||
private String name; | ||
private String planet; | ||
private Instant created = Instant.now(); | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
examples/heist-micronaut/src/main/java/heist/micronaut/MoonController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2018-2021 Agorapulse. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package heist.micronaut; | ||
|
||
import io.micronaut.http.annotation.Controller; | ||
import io.micronaut.http.annotation.Get; | ||
import io.micronaut.http.annotation.PathVariable; | ||
|
||
@Controller("/moons") | ||
class MoonController { | ||
|
||
private final MoonService moonService; | ||
|
||
public MoonController(MoonService moonService) { | ||
this.moonService = moonService; | ||
} | ||
|
||
@Get("/{planet}/{moon}") | ||
Moon sayHello(@PathVariable("planet") String planet, @PathVariable("moon") String moon) { | ||
return moonService.get(planet, moon); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
examples/heist-micronaut/src/main/java/heist/micronaut/MoonService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2018-2021 Agorapulse. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package heist.micronaut; | ||
|
||
public interface MoonService { | ||
|
||
Moon get(String planet, String name); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
micronaut: | ||
application: | ||
name: heistMicronaut |
Oops, something went wrong.