/*************************************************************/
/* Copyright (C) 2016, PERRINN Limited.  All Rights Reserved */
/*                                                           */
/* This software is distributed under the Apache 2.0 license */
/* For usage rights, please contact contact@perrinn.com      */
/*                                                           */
/*************************************************************/

package com.perrinn.appservice.geo;

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;

@Controller
public class CountryController {

	@RequestMapping(value="/Country/GetByCode", method=RequestMethod.GET)
	public @ResponseBody String getCountryByCode(@RequestParam("CC") String sCode) {
		static final String template = "{ \"%s\": \"%s\", \"%s\": \"%s\" }";

		Country c = new Country();
		c.setCountryCode(sCode);
		return String.format(template, "CountryId", String.valueOf(c.getId()), "CountryName", c.getCountryName());
	}

	@RequestMapping(value="/Country/GetById", method=RequestMethod.GET)
	public @ResponseBody String getCountryById(@RequestParam("CI") int id) {
		static final String template = "{ \"%s\": \"%s\", \"%s\": \"%s\" }";

		Country c = new Country();
		c.setId(id);
		return String.format(template, "CountryCode", String.valueOf(c.getCountryCode()), "CountryName", c.getCountryName());
	}

	@RequestMapping(value="/Country/GetByName", method=RequestMethod.GET)
	public @ResponseBody String getCountry(@RequestParam("CN") String sName) {
		static final String template = "{ \"%s\": \"%s\", \"%s\": \"%s\" }";

		Country c = new Country();
		c.setCountryName(sName);
		return String.format(template, "CountryId", String.valueOf(c.getId()), "CountryCode", c.getCountryCode());
	}
}
@@ -974,37 +974,24 @@
  sCode) %7B%0A%09%09
-static final 
 String templ
@@ -1026,32 +1026,32 @@
 s%5C%22: %5C%22%25s%5C%22 %7D%22;%0A
+
 %0A%09%09Country c = n
@@ -1345,37 +1345,24 @@
 int id) %7B%0A%09%09
-static final 
 String templ
@@ -1725,23 +1725,10 @@
 ) %7B%0A
+
 %09%09
-static final 
 Stri

Correct error in Controller