Spring 전환 최소 실행 골격 구현 (role-developer-001)
This commit is contained in:
parent
79498b9bfa
commit
3ddbca90e0
1 changed files with 18 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.example.demo.controller;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class HelloController {
|
||||||
|
|
||||||
|
@GetMapping("/hello")
|
||||||
|
public ResponseEntity<String> hello(@RequestParam(required = false) String name) {
|
||||||
|
String message = (name != null && !name.isBlank())
|
||||||
|
? "Hello, " + name + "!"
|
||||||
|
: "Hello, World!";
|
||||||
|
return ResponseEntity.ok(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue