//修改service
int update(Author author);
//修改 serviceImpl
@Override
@Transactional
public int update(Author author) {
return authorMapper.updateByPrimaryKey(author);
}
//修改controller
@PutMapping("update")
public ResponseEntity update(Author author){
int count=service.update(author);
System.out.println(count);
if(count>0){
return new ResponseEntity<>("修改成功",HttpStatus.OK);
}else {
return new ResponseEntity<>("修改失败",HttpStatus.BAD_REQUEST);
}
}
调试一下看进你的update方法没有,再你这个有没有值,是不是值传的有问题,再看看后台有没有报错
首先你看JAVA的更新方法中能不能获取到值