Skip to content

Commit 4aa55cc

Browse files
authored
hotfix/fix-alert&favorites-62-HwuanPage
1 parent db23ae1 commit 4aa55cc

File tree

8 files changed

+425
-448
lines changed

8 files changed

+425
-448
lines changed

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ plugins {
44
id 'io.spring.dependency-management' version '1.1.7'
55
}
66

7+
ext {
8+
springAiVersion = "1.0.0"
9+
}
10+
711
group = 'sevenstar'
812
version = '0.0.1-SNAPSHOT'
913

@@ -29,6 +33,7 @@ dependencies {
2933
implementation 'org.springframework.boot:spring-boot-starter-web'
3034
implementation 'org.springframework.boot:spring-boot-starter-webflux'
3135
implementation 'org.springframework.boot:spring-boot-starter-validation'
36+
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
3237
compileOnly 'org.projectlombok:lombok'
3338
annotationProcessor 'org.projectlombok:lombok'
3439
testImplementation 'org.springframework.boot:spring-boot-starter-test'
@@ -62,6 +67,17 @@ dependencies {
6267

6368
// mock-inline
6469
testImplementation 'org.mockito:mockito-inline:5.2.0'
70+
// html parser
71+
implementation 'org.jsoup:jsoup:1.21.1'
72+
73+
// pdf parsing
74+
implementation 'org.apache.pdfbox:pdfbox:3.0.5'
75+
}
76+
77+
dependencyManagement {
78+
imports {
79+
mavenBom "org.springframework.ai:spring-ai-bom:$springAiVersion"
80+
}
6581
}
6682

6783
tasks.named('test') {
Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,43 @@
1-
// package sevenstar.marineleisure.alert.controller;
2-
//
3-
// import org.springframework.web.bind.annotation.RequestMapping;
4-
// import org.springframework.web.bind.annotation.RestController;
5-
//
6-
// import lombok.RequiredArgsConstructor;
7-
// import sevenstar.marineleisure.alert.service.JellyfishService;
8-
// import sevenstar.marineleisure.global.domain.BaseResponse;
9-
//
10-
// @RestController
11-
// @RequiredArgsConstructor
12-
// @RequestMapping("/alerts")
13-
// public class AlertController {
14-
// private final JellyfishService jellyfishService;
15-
// private final AlertMapper alertMapper;
16-
//
17-
// /**
18-
// * 사용자에게 해파리출현에 관한 정보를 넘겨주기위한 메서드입니다.
19-
// * @return 해파리 발생 관련 정보
20-
// */
21-
// @GetMapping("/jellyfish")
22-
// public ResponseEntity<BaseResponse<JellyfishResponseDto>> getJellyfishList() {
23-
// List<JellyfishDetailVO> items = jellyfishService.search();
24-
// JellyfishResponseDto result = alertMapper.toResponseDto(items);
25-
// return BaseResponse.success(result);
26-
// }
27-
//
28-
// // 명시적으로 크롤링작업을 호출하기 위함입니다. 프론트에서 사용하지는 않습니다.
29-
// // 동작 테스트 완료했습니다.
30-
// // OpenAi Token발생하므로 꼭 필요할때만 사용해주세요.
31-
// // @GetMapping("/jellyfish/crawl")
32-
// // public ResponseEntity<String> triggerCrawl() {
33-
// // jellyfishService.updateLatestReport();
34-
// // return ResponseEntity.ok("해파리 리포트 크롤링 완료");
35-
// // }
36-
// }
1+
package sevenstar.marineleisure.alert.controller;
2+
3+
import java.util.List;
4+
5+
import org.springframework.http.ResponseEntity;
6+
import org.springframework.web.bind.annotation.GetMapping;
7+
import org.springframework.web.bind.annotation.RequestMapping;
8+
import org.springframework.web.bind.annotation.RestController;
9+
10+
import lombok.RequiredArgsConstructor;
11+
import sevenstar.marineleisure.alert.dto.response.JellyfishResponseDto;
12+
import sevenstar.marineleisure.alert.dto.vo.JellyfishDetailVO;
13+
import sevenstar.marineleisure.alert.mapper.AlertMapper;
14+
import sevenstar.marineleisure.alert.service.JellyfishService;
15+
import sevenstar.marineleisure.global.domain.BaseResponse;
16+
17+
@RestController
18+
@RequiredArgsConstructor
19+
@RequestMapping("/alerts")
20+
public class AlertController {
21+
private final JellyfishService jellyfishService;
22+
private final AlertMapper alertMapper;
23+
24+
/**
25+
* 사용자에게 해파리출현에 관한 정보를 넘겨주기위한 메서드입니다.
26+
* @return 해파리 발생 관련 정보
27+
*/
28+
@GetMapping("/jellyfish")
29+
public ResponseEntity<BaseResponse<JellyfishResponseDto>> getJellyfishList() {
30+
List<JellyfishDetailVO> items = jellyfishService.search();
31+
JellyfishResponseDto result = alertMapper.toResponseDto(items);
32+
return BaseResponse.success(result);
33+
}
34+
35+
// 명시적으로 크롤링작업을 호출하기 위함입니다. 프론트에서 사용하지는 않습니다.
36+
// 동작 테스트 완료했습니다.
37+
// OpenAi Token발생하므로 꼭 필요할때만 사용해주세요.
38+
// @GetMapping("/jellyfish/crawl")
39+
// public ResponseEntity<String> triggerCrawl() {
40+
// jellyfishService.updateLatestReport();
41+
// return ResponseEntity.ok("해파리 리포트 크롤링 완료");
42+
// }
43+
}

src/main/java/sevenstar/marineleisure/alert/dto/vo/JellyfishSpecies.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)