问题描述
两个接口一个@GetMapping("/{companyId}")
,一个 @GetMapping("/getPendingMyApprovalPage")
@RestController
@RequestMapping("/salesman/company-attribute")
public class SalesmanCompanyAttributeController {
@GetMapping("/{companyId}")
public CommonResult<CompanyAttributeVo> getCompanyAttributeVoByCompanyId(@PathVariable Long companyId){
return CommonResult.Success();
}
@GetMapping("/getPendingMyApprovalPage")
public CommonPage<CompanyAttributeVo> getPendingMyApprovalPage(@RequestParam(value = "pageIndex", required = true) Integer pageIndex,
@RequestParam(value = "pageSize", required = true) Integer pageSize){
return CommonPage.pageSuccess(null);
}
}
请求getPendingMyApprovalPage时,不小心输出了下面的错误地址pendingMyApprovalPage:
http://127.0.0.1:8082/salesman/company-attribute/pendingMyApprovalPage?pageIndex=1&pageSize=10
提示Failed to convert value of type ‘java.lang.String’ to required type ‘java.lang.Long’;
{
"code": 400,
"message": "参数错误或数据异常:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long'; nested exception is java.lang.NumberFormatException: For input string: \"pendingMyApprovalPage\"",
"data": null
}
返回这里并为提示我们地址不存在,而且请求到了另一个接口,对我们排错会有误导