Source:
public Article insertArticle(CommonWriter writer, Constants.BOARD_TYPE board, String subject, String content, String categoryCode, List<Gallery> galleries, Constants.DEVICE_TYPE device) { if (! BoardCategoryGenerator.existCategory(board, categoryCode)) throw new ServiceException(ServiceError.NOT_FOUND_CATEGORY); String stripHtmlContent = StringUtils.defaultIfBlank(JakdukUtils.stripHtmlTag(content), StringUtils.EMPTY); String shortContent = StringUtils.truncate(stripHtmlContent, Constants.BOARD_SHORT_CONTENT_LENGTH); ArticleStatus articleStatus = ArticleStatus.builder() .device(device) .build(); ObjectId logId = new ObjectId(); LocalDateTime lastUpdated = LocalDateTime.ofInstant(logId.getDate().toInstant(), ZoneId.systemDefault()); List<String> galleryIds = galleries.stream() .map(Gallery::getId) .collect(Collectors.toList()); Article article = Article.builder() .writer(writer) .board(board.name()) .category(board.equals(Constants.BOARD_TYPE.FREE) ? null : categoryCode) .subject(subject) .content(content) .shortContent(shortContent) .views(0) .seq(commonService.getNextSequence(Constants.SEQ_BOARD)) .status(articleStatus) .logs(this.initBoardLogs(logId, Constants.ARTICLE_HISTORY_TYPE.CREATE.name(), writer)) .lastUpdated(lastUpdated) .linkedGallery(! galleries.isEmpty()) .build(); articleRepository.save(article); rabbitMQPublisher.indexDocumentBoard(article.getId(), article.getSeq(), article.getWriter(), article.getSubject(), article.getContent(), article.getBoard(), article.getCategory(), galleryIds); log.info("new post created. post seq={}, subject={}", article.getSeq(), article.getSubject()); return article; }

Target:
public Article insertArticle(CommonWriter writer, Constants.BOARD_TYPE board, String subject, String content, String categoryCode, List<Gallery> galleries, Constants.DEVICE_TYPE device) { if (BoardCategoryGenerator.notExistCategory(board, categoryCode)) throw new ServiceException(ServiceError.NOT_FOUND_CATEGORY); String stripHtmlContent = StringUtils.defaultIfBlank(JakdukUtils.stripHtmlTag(content), StringUtils.EMPTY); String shortContent = StringUtils.truncate(stripHtmlContent, Constants.BOARD_SHORT_CONTENT_LENGTH); ArticleStatus articleStatus = ArticleStatus.builder() .device(device) .build(); ObjectId logId = new ObjectId(); LocalDateTime lastUpdated = LocalDateTime.ofInstant(logId.getDate().toInstant(), ZoneId.systemDefault()); List<String> galleryIds = galleries.stream() .map(Gallery::getId) .collect(Collectors.toList()); Article article = Article.builder() .writer(writer) .board(board.name()) .category(Constants.BOARD_TYPE.FREE.equals(board) ? null : categoryCode) .subject(subject) .content(content) .shortContent(shortContent) .views(0) .seq(commonService.getNextSequence(Constants.SEQ_BOARD)) .status(articleStatus) .logs(this.initBoardLogs(logId, Constants.ARTICLE_HISTORY_TYPE.CREATE.name(), writer)) .lastUpdated(lastUpdated) .linkedGallery(! galleries.isEmpty()) .build(); articleRepository.save(article); rabbitMQPublisher.indexDocumentBoard(article.getId(), article.getSeq(), article.getWriter(), article.getSubject(), article.getContent(), article.getBoard(), article.getCategory(), galleryIds); log.info("new post created. post seq={}, subject={}", article.getSeq(), article.getSubject()); return article; }