@Test public void queryCollection() { }
public ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body) { String accept = request.getHeader("Accept"); ArrayList<HashMap<String, Object>> res = new ArrayList<>(); List<PaperFullData> paperFullDatas; try { boolean isDeep = false; Boolean deep = body.isDeep(); if (deep != null && deep == true) { isDeep = true; } paperFullDatas = collectionService.queryCollection(body.getQuerry(), isDeep); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.ERROR); HashMap<String, Object> stringStringHashMap = new HashMap<>(); stringStringHashMap.put("message", e.getMessage()); querryResult.addResultsItem(stringStringHashMap); return new ResponseEntity<>(querryResult, HttpStatus.BAD_REQUEST); } QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.OK); paperFullDatas.stream().forEach((e) -> { res.add(e.toMap()); }); querryResult.setResults(res); return new ResponseEntity<QuerryResult>(querryResult, HttpStatus.OK); }
QueryCollectionApiController implements QueryCollectionApi { public ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body) { String accept = request.getHeader("Accept"); ArrayList<HashMap<String, Object>> res = new ArrayList<>(); List<PaperFullData> paperFullDatas; try { boolean isDeep = false; Boolean deep = body.isDeep(); if (deep != null && deep == true) { isDeep = true; } paperFullDatas = collectionService.queryCollection(body.getQuerry(), isDeep); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.ERROR); HashMap<String, Object> stringStringHashMap = new HashMap<>(); stringStringHashMap.put("message", e.getMessage()); querryResult.addResultsItem(stringStringHashMap); return new ResponseEntity<>(querryResult, HttpStatus.BAD_REQUEST); } QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.OK); paperFullDatas.stream().forEach((e) -> { res.add(e.toMap()); }); querryResult.setResults(res); return new ResponseEntity<QuerryResult>(querryResult, HttpStatus.OK); } }
QueryCollectionApiController implements QueryCollectionApi { public ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body) { String accept = request.getHeader("Accept"); ArrayList<HashMap<String, Object>> res = new ArrayList<>(); List<PaperFullData> paperFullDatas; try { boolean isDeep = false; Boolean deep = body.isDeep(); if (deep != null && deep == true) { isDeep = true; } paperFullDatas = collectionService.queryCollection(body.getQuerry(), isDeep); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.ERROR); HashMap<String, Object> stringStringHashMap = new HashMap<>(); stringStringHashMap.put("message", e.getMessage()); querryResult.addResultsItem(stringStringHashMap); return new ResponseEntity<>(querryResult, HttpStatus.BAD_REQUEST); } QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.OK); paperFullDatas.stream().forEach((e) -> { res.add(e.toMap()); }); querryResult.setResults(res); return new ResponseEntity<QuerryResult>(querryResult, HttpStatus.OK); } @org.springframework.beans.factory.annotation.Autowired  QueryCollectionApiController(ObjectMapper objectMapper, HttpServletRequest request); }
QueryCollectionApiController implements QueryCollectionApi { public ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body) { String accept = request.getHeader("Accept"); ArrayList<HashMap<String, Object>> res = new ArrayList<>(); List<PaperFullData> paperFullDatas; try { boolean isDeep = false; Boolean deep = body.isDeep(); if (deep != null && deep == true) { isDeep = true; } paperFullDatas = collectionService.queryCollection(body.getQuerry(), isDeep); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.ERROR); HashMap<String, Object> stringStringHashMap = new HashMap<>(); stringStringHashMap.put("message", e.getMessage()); querryResult.addResultsItem(stringStringHashMap); return new ResponseEntity<>(querryResult, HttpStatus.BAD_REQUEST); } QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.OK); paperFullDatas.stream().forEach((e) -> { res.add(e.toMap()); }); querryResult.setResults(res); return new ResponseEntity<QuerryResult>(querryResult, HttpStatus.OK); } @org.springframework.beans.factory.annotation.Autowired  QueryCollectionApiController(ObjectMapper objectMapper, HttpServletRequest request); ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body); }
QueryCollectionApiController implements QueryCollectionApi { public ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body) { String accept = request.getHeader("Accept"); ArrayList<HashMap<String, Object>> res = new ArrayList<>(); List<PaperFullData> paperFullDatas; try { boolean isDeep = false; Boolean deep = body.isDeep(); if (deep != null && deep == true) { isDeep = true; } paperFullDatas = collectionService.queryCollection(body.getQuerry(), isDeep); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage()); QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.ERROR); HashMap<String, Object> stringStringHashMap = new HashMap<>(); stringStringHashMap.put("message", e.getMessage()); querryResult.addResultsItem(stringStringHashMap); return new ResponseEntity<>(querryResult, HttpStatus.BAD_REQUEST); } QuerryResult querryResult = new QuerryResult(); querryResult.setStatus(StatusCode.OK); paperFullDatas.stream().forEach((e) -> { res.add(e.toMap()); }); querryResult.setResults(res); return new ResponseEntity<QuerryResult>(querryResult, HttpStatus.OK); } @org.springframework.beans.factory.annotation.Autowired  QueryCollectionApiController(ObjectMapper objectMapper, HttpServletRequest request); ResponseEntity<QuerryResult> queryCollection(@ApiParam(value = "") @Valid @RequestBody QuerryInfo body);  }