This commit is contained in:
yuzchen 2024-01-24 09:46:36 +08:00
parent adc141c35c
commit 8a81a280b2
1 changed files with 2 additions and 5 deletions

View File

@ -3,20 +3,17 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.atomic.AtomicLong;
/**
* @author chenyuzhen
*/
@RestController
public class GreetingController {
private static final String template = "Hello, %s!";
private static final String TEMPLATE = "Hello dear, %s!";
@GetMapping("/greeting")
public String greeting(@RequestParam(value = "name", defaultValue = "World") String name) {
return String.format(template, name);
return String.format(TEMPLATE, name);
}