Skip to content

Commit

Permalink
#4 REST API 개발환경 설정
Browse files Browse the repository at this point in the history
- 샘플 API 추가
  • Loading branch information
cloudwisx committed Dec 13, 2021
1 parent db0bc3e commit 95b6d5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/kr/co/hconnect/rest/SampleRestController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@RestController
public class SampleRestController {
Expand All @@ -14,4 +16,9 @@ public class SampleRestController {
public SampleVO doSample(@Valid @RequestBody SampleVO sampleVO) {
return sampleVO;
}

@GetMapping("/api/now")
public String now() {
return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
}
}

0 comments on commit 95b6d5c

Please sign in to comment.