Skip to content

Commit 4f2fcff

Browse files
feat: add home controller module
1 parent cb88a1e commit 4f2fcff

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.countyhospital.healthapi.home;
2+
3+
import java.util.HashMap;
4+
import java.util.Map;
5+
6+
import org.slf4j.Logger;
7+
import org.slf4j.LoggerFactory;
8+
import org.springframework.http.ResponseEntity;
9+
import org.springframework.web.bind.annotation.GetMapping;
10+
import org.springframework.web.bind.annotation.RestController;
11+
12+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
13+
import io.swagger.v3.oas.annotations.responses.ApiResponses;
14+
15+
@RestController
16+
public class HomeController {
17+
18+
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
19+
20+
@GetMapping("/")
21+
@ApiResponses({
22+
@ApiResponse(responseCode = "200", description = "Root response delivered successfully")
23+
})
24+
public ResponseEntity<Map<String, Object>> root() {
25+
26+
logger.debug("Root endpoint accessed");
27+
28+
Map<String, Object> payload = new HashMap<>();
29+
payload.put("status", "OK");
30+
31+
return ResponseEntity.ok(payload);
32+
}
33+
}

0 commit comments

Comments
 (0)