package kr.ac.ajou.dsd.kda.web;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import kr.ac.ajou.dsd.kda.api.ITranslateAPI;


@Controller
public class ExternalAPIController {
	
	ITranslateAPI trans;
	
	@RequestMapping(value = "/translate", method=RequestMethod.GET)
	public @ResponseBody String getTranslateToEng (
			@RequestParam(value="koreanName", defaultValue="김치") String koreanName) {
		
		return trans.translateToEng(koreanName);
		
	}
	
	@RequestMapping(value = "/transliterate", method=RequestMethod.GET, produces = "application/json")
	public @ResponseBody String getTransliterateToEng (
			@RequestParam(value="koreanName", defaultValue="김치") String koreanName) {
		
		return trans.transliteratToEng(koreanName);
		
	}
	
	

}

@@ -81,29 +81,153 @@
 ork.
-stereotype.Controller
+beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.PathVariable
 ;%0Aim
@@ -571,16 +571,26 @@
 er %7B%0A%09%0A%09
+%0A%09private 
 ITransla
@@ -604,16 +604,107 @@
 rans;%0A%09%0A
+%09@Autowired%0A%09ExternalAPIController(ITranslateAPI trans) %7B%0A%09%09%0A%09%09this.trans = trans;%0A%09%09%0A%09%7D%0A%09%0A
 %09@Reques
@@ -731,16 +731,29 @@
 ranslate
+/%7BkoreanName%7D
 %22, metho
@@ -768,18 +768,19 @@
 tMethod.
-GE
+POS
 T)%0A%09publ
@@ -823,36 +823,36 @@
 ToEng (%0A%09%09%09@
-RequestParam
+PathVariable
 (value=%22kore
@@ -858,35 +858,16 @@
 eanName%22
-, defaultValue=%22%EA%B9%80%EC%B9%98%22
 ) String
@@ -975,16 +975,29 @@
 literate
+/%7BkoreanName%7D
 %22, metho
@@ -1016,42 +1016,12 @@
 hod.
-GET, produces = %22application/json%22
+POST
 )%0A%09p
@@ -1075,28 +1075,28 @@
 g (%0A%09%09%09@
-RequestParam
+PathVariable
 (value=%22
@@ -1110,27 +1110,8 @@
 ame%22
-, defaultValue=%22%EA%B9%80%EC%B9%98%22
 ) St

change Controller