File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
src/main/java/com/climbup/climbup/test/controller Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .climbup .climbup .test .controller ;
2+
3+ import io .swagger .v3 .oas .annotations .Operation ;
4+ import io .swagger .v3 .oas .annotations .responses .ApiResponse ;
5+ import org .springframework .http .ResponseEntity ;
6+ import org .springframework .web .bind .annotation .GetMapping ;
7+ import org .springframework .web .bind .annotation .RequestMapping ;
8+ import org .springframework .web .bind .annotation .RestController ;
9+
10+ import java .time .LocalDateTime ;
11+ import java .util .HashMap ;
12+ import java .util .Map ;
13+
14+ @ RestController ()
15+ @ RequestMapping ("/test" )
16+ public class TestController {
17+ @ Operation (summary = "랜덤 숫자 생성" , description = "0-99 사이의 랜덤한 정수를 반환합니다" )
18+ @ ApiResponse (responseCode = "200" , description = "성공적으로 랜덤 숫자를 생성함" )
19+ @ GetMapping ()
20+ public ResponseEntity <Map <String , Object >> getRandomNumber () {
21+ Map <String , Object > response = new HashMap <>();
22+ response .put ("randomNumber" , (int )(Math .random () * 100 ));
23+ response .put ("timestamp" , LocalDateTime .now ());
24+ return ResponseEntity .ok (response );
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments