コード例 #1
0
  @RequestMapping(value = "/keyword/count", method = RequestMethod.GET)
  @ResponseBody
  public String keywordCount() {
    List<KeywordList> keywordLists =
        keywordListService.findByKeywordType(KeywordType.SPACE.getCode(), false);

    int keywordSize = 0;

    for (KeywordList keywordList : keywordLists) {
      keywordSize += keywordList.getKeywordCount();
    }

    return keywordSize + "";
  }
コード例 #2
0
  @RequestMapping(value = "/common/findKeywordList", method = RequestMethod.POST)
  @ResponseBody
  public ResponseData<KeywordList> findKeywordList(
      @RequestParam("keywordType") String keywordType) {
    boolean isDeleted = false;
    List<KeywordList> keywordList = new ArrayList<>();

    try {
      keywordList = keywordListService.findByKeywordType(keywordType, isDeleted);
      return ResponseData.createSuccessResult(keywordList);
    } catch (Exception e) {
      return ResponseData.createFailResult(keywordList);
    }
  }