@RestController
//@Controller
public class CarInfoController {
@Autowired
private CarInfoService carInfoService;
// static Log log = LogFactory.getLog(CarInfoController.class.getName());
@GetMapping("/select")
public ResponseEntity selectById(@RequestParam("id")String carNum){
// log.debug("log4j日志开启");
Carinfo c = new Carinfo();
c.setCarnum(carNum);
c.setMileageday(233.0);
Carinfo carinfo = this.carInfoService.queryListById(c);
System.out.println("-----------------------"+carinfo);
System.out.println("ResponseEntity.ok(carinfo)==============="+ResponseEntity.ok(carinfo));
return ResponseEntity.ok(carinfo);
}
}
```java
http://localhost:8080/select?id=1
HTTP/1.1 200
Content-Length: 0
Date: Wed, 05 Oct 2022 08:19:07 GMT
Keep-Alive: timeout=60
Connection: keep-alive
body is empty>
Response code: 200; Time: 461ms; Content length: 0 bytes
你carinfo结果是啥?
不知道你这个问题是否已经解决, 如果还没有解决的话: