Skip to content

Commit 6452f74

Browse files
committed
Merge branch 'feature/issue-14' into develop
2 parents f8757b0 + 71cc43f commit 6452f74

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies {
2727
implementation 'org.springframework.boot:spring-boot-starter-validation'
2828
implementation 'org.springframework.boot:spring-boot-starter-web'
2929
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
30+
implementation 'org.springframework.boot:spring-boot-starter-cache'
3031
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.10.3'
3132
implementation 'org.jsoup:jsoup:1.13.1'
3233
compileOnly 'org.projectlombok:lombok'

src/main/java/dev/riyenas/chatbot/ChatbotApplication.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cache.annotation.EnableCaching;
56

67
@SpringBootApplication
8+
@EnableCaching
79
public class ChatbotApplication {
810

911
public static void main(String[] args) {

src/main/java/dev/riyenas/chatbot/service/NoticeCrawlService.java

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.jsoup.nodes.Document;
99
import org.jsoup.nodes.Element;
1010
import org.jsoup.select.Elements;
11+
import org.springframework.cache.annotation.Cacheable;
1112
import org.springframework.stereotype.Service;
1213

1314
import java.io.IOException;
@@ -26,6 +27,7 @@ public class NoticeCrawlService {
2627
.link(new Link(NOTICE_URL))
2728
.build();
2829

30+
@Cacheable(value = "sejong")
2931
public ListCard sejongNoticeCrawl() throws IOException {
3032
Document doc = Jsoup.connect(NOTICE_URL).get();
3133
Elements elements = doc.select("body>div>table>tbody>tr");

0 commit comments

Comments
 (0)