SpringBoot 的接口携带参数的两种方式
第一种
@GetMapping("/dtArticle")
public ResponseResult differentTypesArticle(@RequestParam String type){
return ResponseResult.okResult(articleService.differentTypesArticle(type));
}
}
http://127.0.0.1:8081/article/dtArticle?type=学习分享
第二种
@RequestMapping(value = "/dtArticle/{type}",method = RequestMethod.GET)
public Map myGetList(@PathVariable String type){
return ResponseResult.okResult(articleService.differentTypesArticle(type));
}