728x90
์บก์ฒ์ ๊ฐ์ด ์ปจํธ๋กค๋ฌ ํ๋ ๋ง๋ค์ด์ฃผ๊ณ
์๋์ ๊ฐ์ด ์์ค ์ฝ๋ ์์ฑํด์ฃผ๋ฉด ๋๋ค.
package com.bbokkie.coinner.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class MarketController {
@GetMapping("/price")
public double getPrice(
@RequestParam String market, @RequestParam String coin
){
return 123.456;
}
}
๊ทธ๋ฌ๋ฉด ์ด๋ ๊ฒ ํ๋ ์ ํํ๊ฒ ์ ๋ฌํด์ฃผ๋ฉด
123.456์ด ์ถ๋ ฅ๋๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
728x90
'Java & Spring > ์คํ๋ง' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์๋ฐ][์คํ๋ง] DI, Dependency injection (0) | 2023.01.01 |
---|---|
[์๋ฐ][์คํ๋ง] ํฌํธ๋ฒํธ ๋ฐ๊พธ๊ธฐ (0) | 2023.01.01 |
[์คํ๋ง] ์ธํ ๋ฆฌ์ ์ด, ์ดํด๋ฆฝ์ค ์คํ๋ง์คํํธ ์ํฌํธ (0) | 2022.12.20 |
[์คํ๋ง๋ถํธ] STS ์ค์น : Spring Tool Sulte 4 (0) | 2022.12.18 |
[AWS EC2] ์ธ์คํด์ค์์ ํฐ์บฃ์ด ์ ์ค์น๋์ง ์๋ ๊ฑด (0) | 2022.04.20 |