(๊ตฌ)Spring
[์คํ๋ง๋ถํธ]RestController
yeahajeong
2019. 7. 10. 00:10
๋ฐ์ํ
ํด๋์ค ๋ง๋ค๊ธฐ
Package์ Name ์ค์ ํ๊ณ Finish
SampleController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package com.springboot.boot01.controller;
import java.util.Arrays;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SampleController {
@GetMapping("/hello")
public String sayHello() throws Exception {
return "hello world !";
}
@GetMapping("/hobbys")
public List<String> hobbys() throws Exception {
return list;
}
}
|
์๋ฒ ์คํ ํ ๊ฐ๊ฐ์ ์์ฒญ์ ๋ง๋ ์๋ต์ด ๋จ๋์ง ํ์ธํ๋ค.
๋ฐ์ํ