记得上下班打卡 | git大法好,push需谨慎

Commit f95fa375 authored by GaoHu's avatar GaoHu

exit return area.json

parent 4cc807de
......@@ -12,6 +12,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.*;
import java.io.File;
......@@ -108,10 +109,12 @@ public class SmileUserController extends BaseController {
}
@RequestMapping("getAreaJson")
public String getAreaJson(){
@ApiOperation("省市区json")
@ResponseBody
public AjaxResult getAreaJson(){
String jsonStr = "";
try {
File jsonFile = new File("classPath:");
File jsonFile = ResourceUtils.getFile("classpath:static/area.json");
Reader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
int ch = 0;
StringBuffer sb = new StringBuffer();
......@@ -120,7 +123,7 @@ public class SmileUserController extends BaseController {
}
reader.close();
jsonStr = sb.toString();
return jsonStr;
return AjaxResult.success(jsonStr);
} catch (Exception ex) {
ex.printStackTrace();
return null;
......
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