2 回答

TA贡献1862条经验 获得超7个赞
您应该按如下方式定义端点:
@PostMapping(value = Endpoint.RRESOURCE_customer_ID)
public List<CustomerDto> getLocationsByLocationIds(@RequestBody List<Long> ids) {
return customerService.findcustomerIds(ids);
}
请注意,您不能同时拥有@RequestBody和@RequestParam。该字段是任一的HTTP请求体或HTTP请求参数。

TA贡献1757条经验 获得超8个赞
您必须在 ReponseEntity 类中返回“customerDto”列表
@PostMapping(value = Endpoint.RRESOURCE_customer_ID)
@ResponseBody
public ResponseEntity<List<customerDto> > getLocationsByLocationIds(@RequestParam List<Long> ids) {
List<customerDto> customerListDto = customerService.findcustomerIds(ids);
return ResponseEntity.ok(customerListDto);
}
添加回答
举报