Skip to content

Commit

Permalink
Merge pull request #177 from TRIP-Side-Project/dev
Browse files Browse the repository at this point in the history
태그 업데이트에 의한 Main merge
  • Loading branch information
gkfktkrh153 authored Jan 2, 2024
2 parents 1890c42 + fafee27 commit 612f1d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/api/trip/common/init/InitData.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public CommandLineRunner init() {


private void createTag() {
String[] tags = {"부산", "제주", "서울", "요트", "경주", "눈꽃여행", "기차"};
String[] tags = {"부산", "제주", "서울", "강원", "경남", "춘천", "목포", "여수", "안동", "경주", "대구", "대전", "전주"
,"눈꽃", "스키", "보드", "바다", "요트", "해양스포츠", "단풍", "골프"};

for (String name : tags) {
Tag tag = Tag.builder()
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/com/api/trip/common/naverapi/NaverApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
@Service
public class NaverApiService {

private final List<String> tagList = Arrays.asList("부산", "제주", "서울", "크루즈", "일출", "해수욕장");
private final List<String> tagList = Arrays.asList("부산", "제주", "서울", "강원", "경남", "춘천", "목포", "여수", "안동", "경주", "대구", "대전", "전주"
,"눈꽃", "스키", "보드", "바다", "요트", "해양스포츠", "단풍", "골프");

public List<ShoppingItem> doFilterCategory(List<ShoppingItem> items){
List<ShoppingItem> filteredItems = new ArrayList<>();
Expand Down Expand Up @@ -43,6 +44,13 @@ public List<CreateItemRequest> toCreateItemRequest(List<ShoppingItem> items){
}

public List<String> extractTagNames(String title){
return tagList.stream().filter(tag -> title.contains(tag)).toList();
List<String> list = tagList.stream().filter(tag -> title.contains(tag)).toList();

if(title.contains("양양") || title.contains("속초") || title.contains("강릉") || title.contains("평창") || title.contains("강원"))
list.add("강원");
if(title.contains("여수") || title.contains("순천"))
list.add("여수");

return list;
}
}

0 comments on commit 612f1d6

Please sign in to comment.