如何确定访问路径
作者:互联网
@RestController
@RequestMapping("/district")
public class DistrictController extends BaseController{
@Autowired
private IDistrictService districtService;
@RequestMapping("/list{parent}")
public ResponseResult<List<District>> getListByParent(@PathVariable("parent") String parent){
List<District> list=districtService.getListByParent(parent);
return new ResponseResult<>(SUCCESS, list);
}
}
![当路径及注解为如图所示时](https://www.icode9.com/i/ll/?i=20190711151855506.png
访问的路径为http://localhost:8080/district/list?parent=86
访问的路径为http://localhost:8080/district/list/86
标签:getListByParent,parent,district,ResponseResult,路径,list,访问,确定 来源: https://blog.csdn.net/weixin_45016089/article/details/95482237