Missing URI template variable ‘id‘ for method parameter of type int[已解决]
@RestController
@RequestMapping("/checkitem")
@Slf4j
public class CheckitemController {
@Autowired
private BrandService brandService;
//TODO 5 根据id查找,数据回显
@GetMapping("/findById")
public Result findById(@PathVariable int id){
log.info("id为:{}",id);
Brand brand = brandService.getById(id);
if(brand!=null){
return new Result(true,"查询成功",brand);
}else {
throw new RuntimeException("查找失败");
}
}
}