其他分享
首页 > 其他分享> > 如何确定访问路径

如何确定访问路径

作者:互联网

@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