TA的每日心情 | 无聊 4 天前 |
---|
签到天数: 530 天 连续签到: 2 天 [LV.9]测试副司令
|
1测试积点
写了一个接口,我用浏览器、postman、idea的restclient调用这个接口返回的都是这是我的controller@RestController
//@Controller
public class CarInfoController {
@Autowired
private CarInfoService carInfoService;
// static Log log = LogFactory.getLog(CarInfoController.class.getName());
@GetMapping("/select")
public ResponseEntity<Carinfo> 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);
}
}
这是我的测试结果
<span style="font-weight: normal;">```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
<Response body is empty>
Response code: 200; Time: 461ms; Content length: 0 bytes</span>
自己写的项目,没有使用方向,只是我自己配置了aop、拦截器等等找不到原因
|
|