|
@@ -10,6 +10,8 @@
|
|
|
|
|
|
package com.qs.mp.web.controller.api.common;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.qs.mp.common.core.domain.AjaxResult;
|
|
|
import com.qs.mp.common.domain.Area;
|
|
|
import com.qs.mp.common.service.IAreaService;
|
|
|
import com.qs.mp.web.controller.common.BaseApiController;
|
|
@@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
@@ -41,10 +44,10 @@ public class AreaQueryController extends BaseApiController {
|
|
|
*/
|
|
|
@PostMapping("/area/listByPid")
|
|
|
@ApiOperation(value="获取省市区信息", notes="根据省市区的pid获取地址信息")
|
|
|
- @ApiImplicitParam(name = "pid", value = "省市区的pid(pid为0获取所有省份)", required = true, dataType = "String")
|
|
|
- public ResponseEntity<List<Area>> listByPid(Long pid){
|
|
|
- List<Area> list = areaService.listByPid(pid);
|
|
|
- return ResponseEntity.ok(list);
|
|
|
+ public AjaxResult listByPid(@RequestBody JSONObject jsonObject){
|
|
|
+ Long pid = jsonObject.getLong("pid");
|
|
|
+ List<Area> list = areaService.listByPid(pid);
|
|
|
+ return AjaxResult.success(list);
|
|
|
}
|
|
|
|
|
|
}
|