获取URL中的数据,
代码:
@RestController
@RequestMapping("/hello")
public class HelloController {
@Autowired
private PersonsService service;
@RequestMapping(value = "/queryOne/{id}", method = {RequestMethod.GET, RequestMethod.POST})
public Map<String, Object> queryOne(@PathVariable("id") String id) {
Map<String, Object> map = service.selectById(id);
return map;
}
请求: