/**
* 获取通过json文件读取json内容获取下拉树
*
* @return
* @exception/throws [违例类型] [违例说明]
* @see [类、类#方法、类#成员]
*/
public JSONArray getAreaModel() {
JSONArray resultJson = new JSONArray();
String content = null;
File file = null;
try {
// 输入json文件的路径 读取路径为resource路径下的
file = ResourceUtils.getFile("classpath:json/city_code.json");
content = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
resultJson = JSONArray.parseArray(content);
return resultJson;
}