* Update Spring Boot, Spring Native and Native Maven Plugin versions * BAEL-5951: Spring Boot 3 Sample for Native Image builds incl. Runtime Hints * BAEL-5951: Configure POMs and add Swagger UI runtime hints * BAEL-5951: Remove Swagger UI runtime hints * BAEL-5951: Remove Spring Boot3 parent POM from profiles because of JDK17 dependency during build (building the parent POM is even not necessary) * BAEL-5951: Add tests * BAEL-5951: Fix tests (PMD naming conventions)
20 lines
577 B
Java
20 lines
577 B
Java
package com.baeldung.sample;
|
|
|
|
import org.springframework.graphql.data.method.annotation.QueryMapping;
|
|
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;
|
|
|
|
@RestController
|
|
@RequestMapping("/api/v1/user")
|
|
public class UserController {
|
|
|
|
@QueryMapping("getUser")
|
|
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
|
|
public User getUser() {
|
|
return new User("John", "Doe");
|
|
}
|
|
|
|
}
|