Spring 전환 골격 최신 reviewer 검증 #1
1 changed files with 26 additions and 0 deletions
26
src/main/java/com/example/controller/HealthController.java
Normal file
26
src/main/java/com/example/controller/HealthController.java
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package com.example.controller;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Simple REST controller for health check endpoint.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class HealthController {
|
||||
|
||||
@GetMapping("/health")
|
||||
public ResponseEntity<Map<String, String>> health() {
|
||||
return ResponseEntity.ok(Map.of("status", "UP"));
|
||||
}
|
||||
|
||||
@GetMapping("/ping")
|
||||
public ResponseEntity<String> ping() {
|
||||
return ResponseEntity.ok("pong");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue