From 9a25d935f166106cf8a34fbd0be9e04fa8007909 Mon Sep 17 00:00:00 2001 From: Diger Date: Mon, 18 Mar 2024 00:50:48 +0900 Subject: [PATCH] refactor : repackaging legacy --- .../shorts/{ => core}/leagcy/CrawlerBase.kt | 22 +++++----- .../shorts/{ => core}/leagcy/CrawlerCore.kt | 6 +-- .../leagcy/consts/NewsDOMClassNameConst.kt | 2 +- .../leagcy/consts/NewsLinkElementConst.kt | 2 +- .../{ => core}/leagcy/consts/NewsUrlConst.kt | 2 +- .../KomoranKeywordExtractor.kt | 4 +- .../shorts/core/{ => v2}/CrawlerBase.kt | 22 +++++----- .../shorts/core/{ => v2}/CrawlerCore.kt | 40 +++++-------------- .../core/{ => v2}/consts/KeywordWeight.kt | 2 +- .../{ => v2}/consts/NewsDOMClassNameConst.kt | 2 +- .../{ => v2}/consts/NewsLinkElementConst.kt | 2 +- .../core/{ => v2}/consts/NewsUrlConst.kt | 2 +- .../keywordextractor/KeywordExtractor.kt | 2 +- .../LuceneAnalyzerKeywordExtractor.kt | 6 +-- .../{ => v2}/keywordextractor/StopWord.kt | 2 +- .../core/{ => v2}/rank/RankingGenerator.kt | 2 +- 16 files changed, 51 insertions(+), 69 deletions(-) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/{ => core}/leagcy/CrawlerBase.kt (86%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/{ => core}/leagcy/CrawlerCore.kt (98%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/{ => core}/leagcy/consts/NewsDOMClassNameConst.kt (96%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/{ => core}/leagcy/consts/NewsLinkElementConst.kt (96%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/{ => core}/leagcy/consts/NewsUrlConst.kt (95%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/{ => core}/leagcy/keywordextractor/KomoranKeywordExtractor.kt (90%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/CrawlerBase.kt (83%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/CrawlerCore.kt (85%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/consts/KeywordWeight.kt (91%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/consts/NewsDOMClassNameConst.kt (94%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/consts/NewsLinkElementConst.kt (88%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/consts/NewsUrlConst.kt (93%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/keywordextractor/KeywordExtractor.kt (75%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/keywordextractor/LuceneAnalyzerKeywordExtractor.kt (95%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/keywordextractor/StopWord.kt (99%) rename shorts-crawler/src/main/kotlin/com/mashup/shorts/core/{ => v2}/rank/RankingGenerator.kt (95%) diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/CrawlerBase.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/CrawlerBase.kt similarity index 86% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/CrawlerBase.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/CrawlerBase.kt index 7210479e..4c303894 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/CrawlerBase.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/CrawlerBase.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.leagcy +package com.mashup.shorts.core.leagcy import org.jsoup.Jsoup import org.jsoup.select.Elements @@ -6,16 +6,16 @@ import org.springframework.stereotype.Component import com.mashup.shorts.domain.category.Category import com.mashup.shorts.domain.category.CategoryName import com.mashup.shorts.domain.news.News -import com.mashup.shorts.leagcy.consts.CONTENT_CLASS_NAME -import com.mashup.shorts.leagcy.consts.HEADLINE -import com.mashup.shorts.leagcy.consts.IMAGE_ID_NAME -import com.mashup.shorts.leagcy.consts.NORMAL -import com.mashup.shorts.leagcy.consts.PRESS_CLASS_NAME -import com.mashup.shorts.leagcy.consts.SYMBOLIC_LINK_BASE_URL -import com.mashup.shorts.leagcy.consts.TITLE_CLASS_NAME -import com.mashup.shorts.leagcy.consts.WRITTEN_DATETIME_CLASS_NAME -import com.mashup.shorts.leagcy.consts.detailDocClassNames -import com.mashup.shorts.leagcy.consts.moreHeadLineLinksElements +import com.mashup.shorts.core.leagcy.consts.CONTENT_CLASS_NAME +import com.mashup.shorts.core.leagcy.consts.HEADLINE +import com.mashup.shorts.core.leagcy.consts.IMAGE_ID_NAME +import com.mashup.shorts.core.leagcy.consts.NORMAL +import com.mashup.shorts.core.leagcy.consts.PRESS_CLASS_NAME +import com.mashup.shorts.core.leagcy.consts.SYMBOLIC_LINK_BASE_URL +import com.mashup.shorts.core.leagcy.consts.TITLE_CLASS_NAME +import com.mashup.shorts.core.leagcy.consts.WRITTEN_DATETIME_CLASS_NAME +import com.mashup.shorts.core.leagcy.consts.detailDocClassNames +import com.mashup.shorts.core.leagcy.consts.moreHeadLineLinksElements @Deprecated("Deprecated By Changed DOM") @Component("DeprecatedCrawlerBase") diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/CrawlerCore.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/CrawlerCore.kt similarity index 98% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/CrawlerCore.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/CrawlerCore.kt index 4b3fed28..4c6f4754 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/CrawlerCore.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/CrawlerCore.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.leagcy +package com.mashup.shorts.core.leagcy import java.time.LocalDateTime import java.time.format.DateTimeFormatter.ofPattern @@ -10,7 +10,7 @@ import org.springframework.transaction.annotation.Transactional import com.mashup.shorts.common.exception.ShortsBaseException import com.mashup.shorts.common.exception.ShortsErrorCode import com.mashup.shorts.common.util.Slf4j2KotlinLogging.log -import com.mashup.shorts.core.keywordextractor.KeywordExtractor +import com.mashup.shorts.core.v2.keywordextractor.KeywordExtractor import com.mashup.shorts.domain.category.CategoryName.CULTURE import com.mashup.shorts.domain.category.CategoryName.ECONOMIC import com.mashup.shorts.domain.category.CategoryName.POLITICS @@ -25,7 +25,7 @@ import com.mashup.shorts.domain.news.NewsBulkInsertRepository import com.mashup.shorts.domain.news.NewsRepository import com.mashup.shorts.domain.newscard.NewsCard import com.mashup.shorts.domain.newscard.NewsCardBulkInsertRepository -import com.mashup.shorts.leagcy.consts.categoryToUrl +import com.mashup.shorts.core.leagcy.consts.categoryToUrl @Deprecated("Deprecated By Changed DOM") @Component("DeprecatedCrawlerCore") diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsDOMClassNameConst.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsDOMClassNameConst.kt similarity index 96% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsDOMClassNameConst.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsDOMClassNameConst.kt index 6a00c68c..5a29c6ad 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsDOMClassNameConst.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsDOMClassNameConst.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.leagcy.consts +package com.mashup.shorts.core.leagcy.consts import com.mashup.shorts.domain.category.CategoryName diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsLinkElementConst.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsLinkElementConst.kt similarity index 96% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsLinkElementConst.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsLinkElementConst.kt index c328bf3e..827e777a 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsLinkElementConst.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsLinkElementConst.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.leagcy.consts +package com.mashup.shorts.core.leagcy.consts import com.mashup.shorts.domain.category.CategoryName diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsUrlConst.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsUrlConst.kt similarity index 95% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsUrlConst.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsUrlConst.kt index 7d264a21..9e7515d6 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/consts/NewsUrlConst.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/consts/NewsUrlConst.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.leagcy.consts +package com.mashup.shorts.core.leagcy.consts import com.mashup.shorts.domain.category.CategoryName diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/keywordextractor/KomoranKeywordExtractor.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/keywordextractor/KomoranKeywordExtractor.kt similarity index 90% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/keywordextractor/KomoranKeywordExtractor.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/keywordextractor/KomoranKeywordExtractor.kt index c67e0c3d..c04c45e5 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/leagcy/keywordextractor/KomoranKeywordExtractor.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/leagcy/keywordextractor/KomoranKeywordExtractor.kt @@ -1,9 +1,9 @@ -package com.mashup.shorts.leagcy.keywordextractor +package com.mashup.shorts.core.leagcy.keywordextractor import java.util.* import org.springframework.beans.factory.annotation.Qualifier import org.springframework.stereotype.Component -import com.mashup.shorts.core.keywordextractor.KeywordExtractor +import com.mashup.shorts.core.v2.keywordextractor.KeywordExtractor import kr.co.shineware.nlp.komoran.constant.DEFAULT_MODEL import kr.co.shineware.nlp.komoran.core.Komoran diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/CrawlerBase.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/CrawlerBase.kt similarity index 83% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/CrawlerBase.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/CrawlerBase.kt index 8dd96209..2aa4043f 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/CrawlerBase.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/CrawlerBase.kt @@ -1,19 +1,19 @@ -package com.mashup.shorts.core +package com.mashup.shorts.core.v2 import org.jsoup.Jsoup import org.jsoup.select.Elements import org.springframework.context.annotation.Primary import org.springframework.stereotype.Component -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.CONTENT_CLASS_NAME -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.HEADLINE -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.IMAGE_ID_NAME -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.NORMAL -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.PRESS_CLASS_NAME -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.TITLE_CLASS_NAME -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.WRITTEN_DATETIME_CLASS_NAME -import com.mashup.shorts.core.consts.NewsDOMClassNameConst.detailDocClassNames -import com.mashup.shorts.core.consts.NewsLinkElementConst.moreHeadLineLinksElements -import com.mashup.shorts.core.consts.SYMBOLIC_LINK_BASE_URL +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.CONTENT_CLASS_NAME +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.HEADLINE +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.IMAGE_ID_NAME +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.NORMAL +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.PRESS_CLASS_NAME +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.TITLE_CLASS_NAME +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.WRITTEN_DATETIME_CLASS_NAME +import com.mashup.shorts.core.v2.consts.NewsDOMClassNameConst.detailDocClassNames +import com.mashup.shorts.core.v2.consts.NewsLinkElementConst.moreHeadLineLinksElements +import com.mashup.shorts.core.v2.consts.SYMBOLIC_LINK_BASE_URL import com.mashup.shorts.domain.category.Category import com.mashup.shorts.domain.category.CategoryName import com.mashup.shorts.domain.news.News diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/CrawlerCore.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/CrawlerCore.kt similarity index 85% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/CrawlerCore.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/CrawlerCore.kt index 7a42147d..94714dd4 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/CrawlerCore.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/CrawlerCore.kt @@ -1,25 +1,19 @@ -package com.mashup.shorts.core +package com.mashup.shorts.core.v2 import java.time.LocalDateTime import java.time.format.DateTimeFormatter.ofPattern import org.jsoup.select.Elements import org.springframework.beans.factory.annotation.Qualifier import org.springframework.context.annotation.Primary -import org.springframework.retry.annotation.Recover -import org.springframework.retry.annotation.Retryable -import org.springframework.scheduling.annotation.Scheduled import org.springframework.stereotype.Component -import org.springframework.transaction.annotation.Transactional -import com.mashup.shorts.common.exception.ShortsBaseException -import com.mashup.shorts.common.exception.ShortsErrorCode import com.mashup.shorts.common.util.Slf4j2KotlinLogging.log -import com.mashup.shorts.core.consts.CATEGORY_WEIGHT_ONE -import com.mashup.shorts.core.consts.CATEGORY_WEIGHT_ONE_HALF -import com.mashup.shorts.core.consts.CATEGORY_WEIGHT_ONE_QUARTER -import com.mashup.shorts.core.consts.CATEGORY_WEIGHT_TWO_HALF_QUARTER -import com.mashup.shorts.core.consts.categoryToUrl -import com.mashup.shorts.core.keywordextractor.KeywordExtractor -import com.mashup.shorts.core.rank.RankingGenerator +import com.mashup.shorts.core.v2.consts.CATEGORY_WEIGHT_ONE +import com.mashup.shorts.core.v2.consts.CATEGORY_WEIGHT_ONE_HALF +import com.mashup.shorts.core.v2.consts.CATEGORY_WEIGHT_ONE_QUARTER +import com.mashup.shorts.core.v2.consts.CATEGORY_WEIGHT_TWO_HALF_QUARTER +import com.mashup.shorts.core.v2.consts.categoryToUrl +import com.mashup.shorts.core.v2.keywordextractor.KeywordExtractor +import com.mashup.shorts.core.v2.rank.RankingGenerator import com.mashup.shorts.domain.category.Category import com.mashup.shorts.domain.category.CategoryName import com.mashup.shorts.domain.category.CategoryName.CULTURE @@ -47,10 +41,7 @@ class CrawlerCore( private val rankingGenerator: RankingGenerator, ) { - @Retryable(value = [Exception::class], maxAttempts = 3) - @Transactional(rollbackFor = [Exception::class]) - @Scheduled(cron = "0 0 * * * *") - internal fun executeCrawling() { + internal fun executeCrawling(): LocalDateTime { val crawledDateTime = LocalDateTime.now() val keywordsCountingPair = mutableMapOf() val persistenceTargetNewsCards = mutableListOf() @@ -128,22 +119,13 @@ class CrawlerCore( rankingGenerator.saveKeywordRanking(keywordsCountingPair.mapValues { it.value.toInt() }) log.info("$crawledDateTime - all crawling done") + + return crawledDateTime } private fun isBulkInserTiming(persistenceTargetNewsCards: MutableList) = persistenceTargetNewsCards.size >= 100 - @Recover - fun recover(exception: Exception) { - log.error { "크롤링 중 예외가 발생하여 총 3회를 시도했으나 작업이 실패했습니다." } - log.error { "ExceptionStackTrace : ${exception.localizedMessage}" } - log.error { "ExceptionCause : ${exception.cause}" } - throw ShortsBaseException.from( - shortsErrorCode = ShortsErrorCode.E500_INTERNAL_SERVER_ERROR, - resultErrorMessage = "크롤링 중 예외가 발생하여 총 3회를 시도했으나 작업이 실패했습니다." - ) - } - private fun bulkInsertNewsCard( persistenceTargetNewsCards: MutableList, crawledDateTime: LocalDateTime, diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/KeywordWeight.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/KeywordWeight.kt similarity index 91% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/KeywordWeight.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/KeywordWeight.kt index fffd52bb..b9cffe80 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/KeywordWeight.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/KeywordWeight.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.consts +package com.mashup.shorts.core.v2.consts internal const val CATEGORY_WEIGHT_ONE = 1.0 internal const val CATEGORY_WEIGHT_ONE_QUARTER = 1.25 diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsDOMClassNameConst.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsDOMClassNameConst.kt similarity index 94% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsDOMClassNameConst.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsDOMClassNameConst.kt index 50d8648a..77512492 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsDOMClassNameConst.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsDOMClassNameConst.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.consts +package com.mashup.shorts.core.v2.consts import com.mashup.shorts.domain.category.CategoryName diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsLinkElementConst.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsLinkElementConst.kt similarity index 88% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsLinkElementConst.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsLinkElementConst.kt index 1213c292..a6fc2e66 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsLinkElementConst.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsLinkElementConst.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.consts +package com.mashup.shorts.core.v2.consts import com.mashup.shorts.domain.category.CategoryName diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsUrlConst.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsUrlConst.kt similarity index 93% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsUrlConst.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsUrlConst.kt index 1f5b637b..0bc1a360 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/consts/NewsUrlConst.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/consts/NewsUrlConst.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.consts +package com.mashup.shorts.core.v2.consts import com.mashup.shorts.domain.category.CategoryName diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/KeywordExtractor.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/KeywordExtractor.kt similarity index 75% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/KeywordExtractor.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/KeywordExtractor.kt index 5602982b..077d6b3a 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/KeywordExtractor.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/KeywordExtractor.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.keywordextractor +package com.mashup.shorts.core.v2.keywordextractor import org.springframework.stereotype.Component diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/LuceneAnalyzerKeywordExtractor.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/LuceneAnalyzerKeywordExtractor.kt similarity index 95% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/LuceneAnalyzerKeywordExtractor.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/LuceneAnalyzerKeywordExtractor.kt index 92accbc4..ae5fda27 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/LuceneAnalyzerKeywordExtractor.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/LuceneAnalyzerKeywordExtractor.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.keywordextractor +package com.mashup.shorts.core.v2.keywordextractor import java.io.StringReader import org.apache.lucene.analysis.Analyzer @@ -8,8 +8,8 @@ import org.apache.lucene.analysis.ko.KoreanTokenizer.DecompoundMode import org.apache.lucene.analysis.tokenattributes.CharTermAttribute import org.springframework.beans.factory.annotation.Qualifier import org.springframework.stereotype.Component -import com.mashup.shorts.core.consts.CONTENT_WEIGHT -import com.mashup.shorts.core.consts.TITLE_WEIGHT +import com.mashup.shorts.core.v2.consts.CONTENT_WEIGHT +import com.mashup.shorts.core.v2.consts.TITLE_WEIGHT @Component @Qualifier("LuceneAnalyzerKeywordExtractor") diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/StopWord.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/StopWord.kt similarity index 99% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/StopWord.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/StopWord.kt index 77ee989e..4f7bcf06 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/keywordextractor/StopWord.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/keywordextractor/StopWord.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.keywordextractor +package com.mashup.shorts.core.v2.keywordextractor /** 불용어 목록 출처 : https://www.kci.go.kr/kciportal/ci/sereArticleSearch/ciSereArtiView.kci?sereArticleSearchBean.artiId=ART002390885 diff --git a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/rank/RankingGenerator.kt b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/rank/RankingGenerator.kt similarity index 95% rename from shorts-crawler/src/main/kotlin/com/mashup/shorts/core/rank/RankingGenerator.kt rename to shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/rank/RankingGenerator.kt index 905464b7..b38977bc 100644 --- a/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/rank/RankingGenerator.kt +++ b/shorts-crawler/src/main/kotlin/com/mashup/shorts/core/v2/rank/RankingGenerator.kt @@ -1,4 +1,4 @@ -package com.mashup.shorts.core.rank +package com.mashup.shorts.core.v2.rank import org.springframework.stereotype.Component import org.springframework.transaction.annotation.Transactional