@Test public void getProblemStatus() { }
public ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { List<UserProblemStatus> problemStatus = problemStatusService.getProblemStatus(body); List<StatusInfo> collect = problemStatus.stream().map((u) -> { StatusInfo statusInfo = new StatusInfo(); Date date = u.getDate(); if (date == null) { log.warn("查询结果{}的date为null", u); date = new Date(); } statusInfo.setDate(date.getTime()); statusInfo.setProblemId(String.valueOf(u.getProblemId())); statusInfo.setStatus(u.getStatus()); statusInfo.setUnionid(u.getUserUuid()); return statusInfo; }).collect(Collectors.toList()); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setResults(collect); statusInfoList.setStatus(StatusCode.OK); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.OK); } catch (Exception e) { log.error("Couldn't serialize response for content type application/json", e); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setStatus(StatusCode.ERROR); StatusInfo statusInfo = new StatusInfo(); statusInfo.setStatus(e.getMessage()); statusInfoList.addResultsItem(statusInfo); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.BAD_REQUEST); } } return new ResponseEntity<StatusInfoList>(HttpStatus.NOT_IMPLEMENTED); }
ProblemStatusApiController implements ProblemStatusApi { public ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { List<UserProblemStatus> problemStatus = problemStatusService.getProblemStatus(body); List<StatusInfo> collect = problemStatus.stream().map((u) -> { StatusInfo statusInfo = new StatusInfo(); Date date = u.getDate(); if (date == null) { log.warn("查询结果{}的date为null", u); date = new Date(); } statusInfo.setDate(date.getTime()); statusInfo.setProblemId(String.valueOf(u.getProblemId())); statusInfo.setStatus(u.getStatus()); statusInfo.setUnionid(u.getUserUuid()); return statusInfo; }).collect(Collectors.toList()); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setResults(collect); statusInfoList.setStatus(StatusCode.OK); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.OK); } catch (Exception e) { log.error("Couldn't serialize response for content type application/json", e); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setStatus(StatusCode.ERROR); StatusInfo statusInfo = new StatusInfo(); statusInfo.setStatus(e.getMessage()); statusInfoList.addResultsItem(statusInfo); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.BAD_REQUEST); } } return new ResponseEntity<StatusInfoList>(HttpStatus.NOT_IMPLEMENTED); } }
ProblemStatusApiController implements ProblemStatusApi { public ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { List<UserProblemStatus> problemStatus = problemStatusService.getProblemStatus(body); List<StatusInfo> collect = problemStatus.stream().map((u) -> { StatusInfo statusInfo = new StatusInfo(); Date date = u.getDate(); if (date == null) { log.warn("查询结果{}的date为null", u); date = new Date(); } statusInfo.setDate(date.getTime()); statusInfo.setProblemId(String.valueOf(u.getProblemId())); statusInfo.setStatus(u.getStatus()); statusInfo.setUnionid(u.getUserUuid()); return statusInfo; }).collect(Collectors.toList()); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setResults(collect); statusInfoList.setStatus(StatusCode.OK); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.OK); } catch (Exception e) { log.error("Couldn't serialize response for content type application/json", e); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setStatus(StatusCode.ERROR); StatusInfo statusInfo = new StatusInfo(); statusInfo.setStatus(e.getMessage()); statusInfoList.addResultsItem(statusInfo); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.BAD_REQUEST); } } return new ResponseEntity<StatusInfoList>(HttpStatus.NOT_IMPLEMENTED); } @org.springframework.beans.factory.annotation.Autowired  ProblemStatusApiController(ObjectMapper objectMapper, HttpServletRequest request); }
ProblemStatusApiController implements ProblemStatusApi { public ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { List<UserProblemStatus> problemStatus = problemStatusService.getProblemStatus(body); List<StatusInfo> collect = problemStatus.stream().map((u) -> { StatusInfo statusInfo = new StatusInfo(); Date date = u.getDate(); if (date == null) { log.warn("查询结果{}的date为null", u); date = new Date(); } statusInfo.setDate(date.getTime()); statusInfo.setProblemId(String.valueOf(u.getProblemId())); statusInfo.setStatus(u.getStatus()); statusInfo.setUnionid(u.getUserUuid()); return statusInfo; }).collect(Collectors.toList()); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setResults(collect); statusInfoList.setStatus(StatusCode.OK); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.OK); } catch (Exception e) { log.error("Couldn't serialize response for content type application/json", e); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setStatus(StatusCode.ERROR); StatusInfo statusInfo = new StatusInfo(); statusInfo.setStatus(e.getMessage()); statusInfoList.addResultsItem(statusInfo); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.BAD_REQUEST); } } return new ResponseEntity<StatusInfoList>(HttpStatus.NOT_IMPLEMENTED); } @org.springframework.beans.factory.annotation.Autowired  ProblemStatusApiController(ObjectMapper objectMapper, HttpServletRequest request); ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body); ResponseEntity<BasicResponse> problemStatus(@ApiParam(value = "") @Valid @RequestBody StatusInfo body); }
ProblemStatusApiController implements ProblemStatusApi { public ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { List<UserProblemStatus> problemStatus = problemStatusService.getProblemStatus(body); List<StatusInfo> collect = problemStatus.stream().map((u) -> { StatusInfo statusInfo = new StatusInfo(); Date date = u.getDate(); if (date == null) { log.warn("查询结果{}的date为null", u); date = new Date(); } statusInfo.setDate(date.getTime()); statusInfo.setProblemId(String.valueOf(u.getProblemId())); statusInfo.setStatus(u.getStatus()); statusInfo.setUnionid(u.getUserUuid()); return statusInfo; }).collect(Collectors.toList()); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setResults(collect); statusInfoList.setStatus(StatusCode.OK); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.OK); } catch (Exception e) { log.error("Couldn't serialize response for content type application/json", e); StatusInfoList statusInfoList = new StatusInfoList(); statusInfoList.setStatus(StatusCode.ERROR); StatusInfo statusInfo = new StatusInfo(); statusInfo.setStatus(e.getMessage()); statusInfoList.addResultsItem(statusInfo); return new ResponseEntity<StatusInfoList>(statusInfoList, HttpStatus.BAD_REQUEST); } } return new ResponseEntity<StatusInfoList>(HttpStatus.NOT_IMPLEMENTED); } @org.springframework.beans.factory.annotation.Autowired  ProblemStatusApiController(ObjectMapper objectMapper, HttpServletRequest request); ResponseEntity<StatusInfoList> getProblemStatus(@ApiParam(value = "") @Valid @RequestBody ProblemIdList body); ResponseEntity<BasicResponse> problemStatus(@ApiParam(value = "") @Valid @RequestBody StatusInfo body);  }