Commit 67efb356 authored by Quxl's avatar Quxl

x

parent 9f67b38e
...@@ -10,5 +10,7 @@ public interface CountryService { ...@@ -10,5 +10,7 @@ public interface CountryService {
public Map<String, String> queryCountryMap(); public Map<String, String> queryCountryMap();
public Map<String, String> queryCountryMapReverse(); public Map<String, String> queryCountryMapReverse();
public Object queryAsiaCountryList();
} }
...@@ -54,7 +54,19 @@ public class CountryServiceImpl implements CountryService { ...@@ -54,7 +54,19 @@ public class CountryServiceImpl implements CountryService {
} }
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(JSON.toJSONString(new CountryServiceImpl().queryCountryList()));
} }
@Override
public Object queryAsiaCountryList() {
String json = Common.getStringAsStream("doc/country_asia.json");
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
for(Object obj: JSON.parseArray(json)) {
Map<?, ?> objMap = (Map<?, ?>)obj;
list.add(objMap.entrySet().stream().collect(Collectors.toMap((e) -> (String)e.getValue(), (e) -> (String)e.getKey())));
}
return list;
}
} }
...@@ -39,6 +39,13 @@ public class CommonApiController { ...@@ -39,6 +39,13 @@ public class CommonApiController {
return Rjx.jsonOk().setData(countryService.queryCountryList()); return Rjx.jsonOk().setData(countryService.queryCountryList());
} }
@ResponseBody
@PostMapping("getAsiaCountryList")
@ApiOperation("获取国家对照表")
public Object getAsiaCountryList() {
return Rjx.jsonOk().setData(countryService.queryAsiaCountryList());
}
@ResponseBody @ResponseBody
@PostMapping("getLanguageList") @PostMapping("getLanguageList")
......
[
{
"China": "中国"
},
{
"HongKong China": "中国香港"
},
{
"Macao China": "中国澳门"
},
{
"Taiwan China": "中国台湾"
},
{
"Mongolia": "蒙古"
},
{
"North Korea": "朝鲜"
},
{
"South Korea": "韩国"
},
{
"Japan": "日本"
},
{
"Philippines": "菲律宾"
},
{
"Vietnam": "越南"
},
{
"Laos": "老挝"
},
{
"Cambodia": "柬埔寨"
},
{
"Myanmar": "缅甸"
},
{
"Thailand": "泰国"
},
{
"Malaysia": "马来西亚"
},
{
"Brunei": "文莱"
},
{
"Singapore": "新加坡"
},
{
"Indonesia": "印度尼西亚"
},
{
"Democratic Republic of Timor-Leste": "东帝汶"
},
{
"Nepal": "尼泊尔"
},
{
"Bhutan": "不丹"
},
{
"Bangladesh": "孟加拉国"
},
{
"India": "印度"
},
{
"Pakistan": "巴基斯坦"
},
{
"Sri Lanka": "斯里兰卡"
},
{
"Maldives": "马尔代夫"
},
{
"Kazakhstan": "哈萨克斯坦"
},
{
"Kyrgyzstan": "吉尔吉斯斯坦"
},
{
"Tajikistan": "塔吉克斯坦"
},
{
"Uzbekistan": "乌兹别克斯坦"
},
{
"Turkmenistan": "土库曼斯坦"
},
{
"Afghanistan": "阿富汗"
},
{
"Iraq": "伊拉克"
},
{
"Iran": "伊朗"
},
{
"Syria": "叙利亚"
},
{
"Jordan": "约旦"
},
{
"Lebanon": "黎巴嫩"
},
{
"Israel": "以色列"
},
{
"Palestinian Territory": "巴勒斯坦"
},
{
"Saudi Arabia": "沙特阿拉伯"
},
{
"Bahrain": "巴林 "
},
{
"Qatar": "卡塔尔"
},
{
"Kuwait": "科威特"
},
{
"United Arab Emirates": "阿拉伯联合酋长国(阿联酋)"
},
{
"Oman": "阿曼"
},
{
"Yemen": "也门"
},
{
"Georgia": "格鲁吉亚"
},
{
"Armenia": "亚美尼亚"
},
{
"Azerbaijan": "阿塞拜疆"
},
{
"Turkey": "土耳其"
},
{
"Cyprus": "塞浦路斯"
}
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment