Skip to content

Commit

Permalink
Merge pull request #114 from dnd-side-project/develop
Browse files Browse the repository at this point in the history
[main <- develop]
  • Loading branch information
HunSeongPark authored Feb 14, 2024
2 parents 9a92801 + 9fb31d9 commit f34af1b
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 135 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,6 @@ gradle-app.setting
# Java heap dump
*.hprof

# End of https://www.toptal.com/developers/gitignore/api/intellij+all,macos,windows,gradle,java
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,macos,windows,gradle,java

src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,7 @@ public BookmarkTypeInformationResponse getBookmarkTypeInformation(
@GetMapping
public ResponseEntity<Slice<BookmarkResponse>> searchBookmarks(
@Parameter(hidden = true) @AuthenticationPrincipal MemberDetails memberDetails,
@Parameter(
description = "<p>๋ถ๋งˆํฌ ๊ฒ€์ƒ‰ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>ALL - ์ „์ฒด ์กฐํšŒ</li>" +
"<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>" +
"<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>" +
"</ul>",
example = "ALL"
) @RequestParam BookmarkSearchType searchType,
@Parameter(description = "์กฐํšŒํ•  ๋ถ๋งˆํฌ ์ข…๋ฅ˜") @RequestParam BookmarkSearchType searchType,
@Parameter(
description = "ํŽ˜์ด์ง€ ๋ฒˆํ˜ธ (0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค). ๊ธฐ๋ณธ๊ฐ’์€ 0์ž…๋‹ˆ๋‹ค.",
example = "0"
Expand All @@ -100,7 +92,7 @@ public ResponseEntity<Slice<BookmarkResponse>> searchBookmarks(
"<li>LATEST - ์ตœ์‹ ์ˆœ</li>" +
"<li>POPULARITY - ์ธ๊ธฐ์ˆœ</li>" +
"</ul>",
example = "ALL"
example = "LATEST"
)
@RequestParam(required = false, defaultValue = "LATEST") BookmarkSearchSort sort
) {
Expand All @@ -125,17 +117,7 @@ public ResponseEntity<Slice<BookmarkResponse>> searchBookmarks(
@GetMapping("/all/summaries")
public List<BookmarkResponse> searchAllBookmarkSummaries(
@Parameter(hidden = true) @AuthenticationPrincipal MemberDetails memberDetails,
@Parameter(
description = """
<p>๋ถ๋งˆํฌ ๊ฒ€์ƒ‰ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>
<ul>
<li>ALL - ์ „์ฒด ์กฐํšŒ</li>
<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>
<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>
</ul>
""",
example = "ALL"
) @RequestParam BookmarkSearchType searchType
@Parameter(description = "๊ฒ€์ƒ‰ํ•  ๋ถ๋งˆํฌ ์ข…๋ฅ˜") @RequestParam BookmarkSearchType searchType
) {
List<BookmarkDto> bookmarkDtos = bookmarkService.searchAllBookmarks(memberDetails.getId(), searchType);
return bookmarkDtos.stream()
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/dnd/reetplace/app/domain/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Search extends BaseTimeEntity {
@Column(name = "search_id")
private Long id;

@Column(nullable = false)
@Column(nullable = false, unique = true)
private String query;

@ManyToOne(fetch = FetchType.LAZY)
Expand All @@ -36,4 +36,8 @@ private Search(String query, Member member) {
this.query = query;
this.member = member;
}

public void modifyUpdateAt() {
this.updatedAt = LocalDateTime.now();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ public class BookmarkCreateRequest {
@Schema(description = "์žฅ์†Œ ์ •๋ณด")
private PlaceRequest place;

@Schema(description = "<p>๋ถ๋งˆํฌ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>" +
"<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>" +
"</ul>",
example = "WANT")
@Schema(description = "๋ถ๋งˆํฌ ์ข…๋ฅ˜")
@NotNull
private BookmarkType type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
@Getter
public class BookmarkUpdateRequest {

@Schema(description = "<p>๋ถ๋งˆํฌ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>" +
"<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>" +
"</ul>",
example = "WANT")
@Schema(description = "๋ถ๋งˆํฌ ์ข…๋ฅ˜")
@NotNull
private BookmarkType type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ public class BookmarkResponse {
@Schema(description = "๋ถ๋งˆํฌ ํ•œ ์žฅ์†Œ ์ •๋ณด")
private PlaceResponse place;

@Schema(description = """
<p>๋ถ๋งˆํฌ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>
<ul>
<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>
<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>
</ul>
""",
example = "WANT")
@Schema(description = "๋ถ๋งˆํฌ ์ข…๋ฅ˜")
private BookmarkType type;

@Schema(description = "์ธ๋„ค์ผ ์ด๋ฏธ์ง€ url", example = "https://t1.daumcdn.net/place/75B5CF9ACCF84162A7E13CB1FD4D5D43")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ public class BookmarkSummaryResponse {
@Schema(description = "๋ถ๋งˆํฌ ํ•œ ์žฅ์†Œ ์ •๋ณด")
private PlaceSummaryResponse place;

@Schema(description = """
<p>๋ถ๋งˆํฌ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>
<ul>
<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>
<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>
</ul>
""",
example = "WANT")
@Schema(description = "๋ถ๋งˆํฌ ์ข…๋ฅ˜")
private BookmarkType type;

public static BookmarkSummaryResponse from(BookmarkDto bookmarkDto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,7 @@ public class PlaceGetResponse {
@Schema(description = "๊ฒฝ๋„", example = "126.93713158887188")
private String lng;

@Schema(description = "<p>๋ถ๋งˆํฌ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>" +
"<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>" +
"<li>๋ถ๋งˆํฌ๊ฐ€ ์—†์„ ์‹œ null</li>" +
"</ul>",
example = "WANT")
@Schema(description = "๋ถ๋งˆํฌ ์ข…๋ฅ˜")
private BookmarkType type;

@Schema(description = "๋ถ๋งˆํฌ ๊ณ ์œ  id๊ฐ’ (๋ถ๋งˆํฌ ์—†์„ ์‹œ null)", example = "1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,83 +28,83 @@ public class PlaceSearchResponse {
private String thumbnailImage;

@Schema(description = "<p>์นดํ…Œ๊ณ ๋ฆฌ ๊ทธ๋ฃน ์ฝ”๋“œ. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>MT1 - ๋Œ€ํ˜•๋งˆํŠธ</li>" +
"<li>CS2 - ํŽธ์˜์ </li>" +
"<li>PS3 - ์–ด๋ฆฐ์ด์ง‘, ์œ ์น˜์›</li>" +
"<li>SC4 - ํ•™๊ต</li>" +
"<li>AC5 - ํ•™์›</li>" +
"<li>PK6 - ์ฃผ์ฐจ์žฅ</li>" +
"<li>OL7 - ์ฃผ์œ ์†Œ, ์ถฉ์ „์†Œ</li>" +
"<li>SW8 - ์ง€ํ•˜์ฒ ์—ญ</li>" +
"<li>BK9 - ์€ํ–‰</li>" +
"<li>CT1 - ๋ฌธํ™”์‹œ์„ค</li>" +
"<li>AG2 - ์ค‘๊ฐœ์—…์†Œ</li>" +
"<li>PO3 - ๊ณต๊ณต๊ธฐ๊ด€</li>" +
"<li>AT4 - ๊ด€๊ด‘๋ช…์†Œ</li>" +
"<li>AD5 - ์ˆ™๋ฐ•</li>" +
"<li>FD6 - ์Œ์‹์ </li>" +
"<li>CE7 - ์นดํŽ˜</li>" +
"<li>HP8 - ๋ณ‘์›</li>" +
"<li>PM9 - ์•ฝ๊ตญ</li>" +
"</ul>",
"<ul>" +
"<li>MT1 - ๋Œ€ํ˜•๋งˆํŠธ</li>" +
"<li>CS2 - ํŽธ์˜์ </li>" +
"<li>PS3 - ์–ด๋ฆฐ์ด์ง‘, ์œ ์น˜์›</li>" +
"<li>SC4 - ํ•™๊ต</li>" +
"<li>AC5 - ํ•™์›</li>" +
"<li>PK6 - ์ฃผ์ฐจ์žฅ</li>" +
"<li>OL7 - ์ฃผ์œ ์†Œ, ์ถฉ์ „์†Œ</li>" +
"<li>SW8 - ์ง€ํ•˜์ฒ ์—ญ</li>" +
"<li>BK9 - ์€ํ–‰</li>" +
"<li>CT1 - ๋ฌธํ™”์‹œ์„ค</li>" +
"<li>AG2 - ์ค‘๊ฐœ์—…์†Œ</li>" +
"<li>PO3 - ๊ณต๊ณต๊ธฐ๊ด€</li>" +
"<li>AT4 - ๊ด€๊ด‘๋ช…์†Œ</li>" +
"<li>AD5 - ์ˆ™๋ฐ•</li>" +
"<li>FD6 - ์Œ์‹์ </li>" +
"<li>CE7 - ์นดํŽ˜</li>" +
"<li>HP8 - ๋ณ‘์›</li>" +
"<li>PM9 - ์•ฝ๊ตญ</li>" +
"</ul>",
example = "CE7")
private PlaceCategoryGroupCode categoryGroupCode;

@Schema(description = "์นด์นด์˜ค ๋‚ด ์นดํ…Œ๊ณ ๋ฆฌ ๋ถ„๋ฅ˜", example = "๊ฐ€์ •,์ƒํ™œ > ๋ฌธ๊ตฌ,์‚ฌ๋ฌด์šฉํ’ˆ")
private String kakaoCategoryName;

@Schema(description = "<p>์นดํ…Œ๊ณ ๋ฆฌ. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>FOOD - ์‹๋„๋ฝ</li>" +
"<li>ACTIVITY - ์•กํ‹ฐ๋น„ํ‹ฐ</li>" +
"<li>PHOTO_BOOTH - ํฌํ† ๋ถ€์Šค</li>" +
"<li>SHOPPING - ์‡ผํ•‘</li>" +
"<li>CAFE - ์นดํŽ˜</li>" +
"<li>CULTURE - ๋ฌธํ™”์ƒํ™œ</li>" +
"</ul>",
"<ul>" +
"<li>FOOD - ์‹๋„๋ฝ</li>" +
"<li>ACTIVITY - ์•กํ‹ฐ๋น„ํ‹ฐ</li>" +
"<li>PHOTO_BOOTH - ํฌํ† ๋ถ€์Šค</li>" +
"<li>SHOPPING - ์‡ผํ•‘</li>" +
"<li>CAFE - ์นดํŽ˜</li>" +
"<li>CULTURE - ๋ฌธํ™”์ƒํ™œ</li>" +
"</ul>",
example = "ACTIVITY")
private PlaceCategory category;

@Schema(description = "<p>ํ•˜์œ„ ์นดํ…Œ๊ณ ๋ฆฌ. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>KOREAN - ํ•œ์‹</li>" +
"<li>CHINESE - ์ค‘์‹</li>" +
"<li>JAPANESE - ์ผ์‹</li>" +
"<li>WESTERN - ์–‘์‹</li>" +
"<li>WORLD - ์„ธ๊ณ„์Œ์‹(๋ฉ•์‹œ์นธ, ๋ธŒ๋ผ์งˆ, ์•„์‹œ์•„์Œ์‹)</li>" +
"<li>COOKING_BAR - ํ˜ธํ”„,์š”๋ฆฌ์ฃผ์ </li>" +
"<li>IZAKAYA - ์ผ๋ณธ์‹์ฃผ์ </li>" +
"<li>STREET_TENT_RESTAURANT - ํฌ์žฅ๋งˆ์ฐจ</li>" +
"<li>WINE_BAR - ์™€์ธ๋ฐ”</li>" +
"<li>COCKTAIL_BAR - ์นตํ…Œ์ผ๋ฐ”</li>" +
"<li>BOWLING - ๋ณผ๋ง์žฅ</li>" +
"<li>PC - ํ”ผ์‹œ๋ฐฉ</li>" +
"<li>BILLIARDS - ๋‹น๊ตฌ์žฅ</li>" +
"<li>KARAOKE - ๋…ธ๋ž˜๋ฐฉ</li>" +
"<li>BOARD_GAME - ๋ณด๋“œ์นดํŽ˜</li>" +
"<li>PARK - ๊ณต์›</li>" +
"<li>ROLLER - ๋กค๋Ÿฌ์žฅ</li>" +
"<li>COIN_KARAOKE - ์ฝ”์ธ๋…ธ๋ž˜๋ฐฉ</li>" +
"<li>LIFE_FOUR_CUT - ์ธ์ƒ๋„ค์ปท</li>" +
"<li>PHOTO_SIGNATURE - ํฌํ† ์‹œ๊ทธ๋‹ˆ์ฒ˜</li>" +
"<li>HARU_FILM - ํ•˜๋ฃจํ•„๋ฆ„</li>" +
"<li>SIHYUN_HADA - ์‹œํ˜„ํ•˜๋‹ค ํ”„๋ ˆ์ž„</li>" +
"<li>MONO_MANSION - ๋ชจ๋…ธ๋งจ์…˜</li>" +
"<li>RGB_PHOTO - RGB ํฌํ† </li>" +
"<li>PHOTOISM - ํฌํ† ์ด์ฆ˜</li>" +
"<li>DEPARTMENT_STORE - ๋ฐฑํ™”์ </li>" +
"<li>MART - ๋งˆํŠธ</li>" +
"<li>MARKET - ์‹œ์žฅ</li>" +
"<li>CAFE - ์นดํŽ˜</li>" +
"<li>BOOK - ๋ถ์นดํŽ˜</li>" +
"<li>CARTOON - ๋งŒํ™”์นดํŽ˜</li>" +
"<li>DESERT - ๋””์ €ํŠธ์นดํŽ˜</li>" +
"<li>FRESH_FRUIT - ์ƒ๊ณผ์ผ์ „๋ฌธ์ </li>" +
"<li>CINEMA - ์˜ํ™”๊ด€</li>" +
"<li>CAR_CINEMA - ์ž๋™์ฐจ๊ทน์žฅ</li>" +
"<li>CONCERT - ๊ณต์—ฐ์žฅ,์—ฐ๊ทน๊ทน์žฅ</li>" +
"</ul>",
"<ul>" +
"<li>KOREAN - ํ•œ์‹</li>" +
"<li>CHINESE - ์ค‘์‹</li>" +
"<li>JAPANESE - ์ผ์‹</li>" +
"<li>WESTERN - ์–‘์‹</li>" +
"<li>WORLD - ์„ธ๊ณ„์Œ์‹(๋ฉ•์‹œ์นธ, ๋ธŒ๋ผ์งˆ, ์•„์‹œ์•„์Œ์‹)</li>" +
"<li>COOKING_BAR - ํ˜ธํ”„,์š”๋ฆฌ์ฃผ์ </li>" +
"<li>IZAKAYA - ์ผ๋ณธ์‹์ฃผ์ </li>" +
"<li>STREET_TENT_RESTAURANT - ํฌ์žฅ๋งˆ์ฐจ</li>" +
"<li>WINE_BAR - ์™€์ธ๋ฐ”</li>" +
"<li>COCKTAIL_BAR - ์นตํ…Œ์ผ๋ฐ”</li>" +
"<li>BOWLING - ๋ณผ๋ง์žฅ</li>" +
"<li>PC - ํ”ผ์‹œ๋ฐฉ</li>" +
"<li>BILLIARDS - ๋‹น๊ตฌ์žฅ</li>" +
"<li>KARAOKE - ๋…ธ๋ž˜๋ฐฉ</li>" +
"<li>BOARD_GAME - ๋ณด๋“œ์นดํŽ˜</li>" +
"<li>PARK - ๊ณต์›</li>" +
"<li>ROLLER - ๋กค๋Ÿฌ์žฅ</li>" +
"<li>COIN_KARAOKE - ์ฝ”์ธ๋…ธ๋ž˜๋ฐฉ</li>" +
"<li>LIFE_FOUR_CUT - ์ธ์ƒ๋„ค์ปท</li>" +
"<li>PHOTO_SIGNATURE - ํฌํ† ์‹œ๊ทธ๋‹ˆ์ฒ˜</li>" +
"<li>HARU_FILM - ํ•˜๋ฃจํ•„๋ฆ„</li>" +
"<li>SIHYUN_HADA - ์‹œํ˜„ํ•˜๋‹ค ํ”„๋ ˆ์ž„</li>" +
"<li>MONO_MANSION - ๋ชจ๋…ธ๋งจ์…˜</li>" +
"<li>RGB_PHOTO - RGB ํฌํ† </li>" +
"<li>PHOTOISM - ํฌํ† ์ด์ฆ˜</li>" +
"<li>DEPARTMENT_STORE - ๋ฐฑํ™”์ </li>" +
"<li>MART - ๋งˆํŠธ</li>" +
"<li>MARKET - ์‹œ์žฅ</li>" +
"<li>CAFE - ์นดํŽ˜</li>" +
"<li>BOOK - ๋ถ์นดํŽ˜</li>" +
"<li>CARTOON - ๋งŒํ™”์นดํŽ˜</li>" +
"<li>DESERT - ๋””์ €ํŠธ์นดํŽ˜</li>" +
"<li>FRESH_FRUIT - ์ƒ๊ณผ์ผ์ „๋ฌธ์ </li>" +
"<li>CINEMA - ์˜ํ™”๊ด€</li>" +
"<li>CAR_CINEMA - ์ž๋™์ฐจ๊ทน์žฅ</li>" +
"<li>CONCERT - ๊ณต์—ฐ์žฅ,์—ฐ๊ทน๊ทน์žฅ</li>" +
"</ul>",
example = "ACTIVITY_BOARD_GAME")
private PlaceSubCategory subCategory;

Expand All @@ -123,13 +123,7 @@ public class PlaceSearchResponse {
@Schema(description = "๊ฒฝ๋„", example = "126.93713158887188")
private String lng;

@Schema(description = "<p>๋ถ๋งˆํฌ ์ข…๋ฅ˜. ๋ชฉ๋ก์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Œ</p>" +
"<ul>" +
"<li>WANT - ๊ฐ€๋ณด๊ณ  ์‹ถ์–ด์š”</li>" +
"<li>GONE - ๋‹ค๋…€์™”์–ด์š”</li>" +
"<li>๋ถ๋งˆํฌ๊ฐ€ ์—†์„ ์‹œ null</li>" +
"</ul>",
example = "WANT")
@Schema(description = "๋ถ๋งˆํฌ ์ข…๋ฅ˜")
private BookmarkType type;

@Schema(description = "๋ถ๋งˆํฌ ๊ณ ์œ  id๊ฐ’ (๋ถ๋งˆํฌ ์—†์„ ์‹œ null)", example = "1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class SearchDto {
private LocalDateTime createdAt;

public static SearchDto from(Search entity) {
return of(MemberDto.from(entity.getMember()), entity.getId(), entity.getQuery(), entity.getCreatedAt());
return of(MemberDto.from(entity.getMember()), entity.getId(), entity.getQuery(), entity.getUpdatedAt());
}

public static SearchDto of(MemberDto member, Long id, String query, LocalDateTime createdAt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface SearchRepository extends JpaRepository<Search, Long>, SearchRep
@Query("select count(s.id) from Search s where s.member.id = :memberId and s.deletedAt is null")
int countByMemberId(Long memberId);

@Query("select s from Search s join fetch s.member m where s.member.id = :memberId and s.deletedAt is null")
@Query("select s from Search s join fetch s.member m where s.member.id = :memberId and s.deletedAt is null order by s.updatedAt desc")
List<Search> findByMemberIdAndDeletedAtIsNull(Long memberId);

@Query("select s from Search s join fetch s.member m where s.id = :searchId and s.deletedAt is null")
Expand All @@ -22,4 +22,6 @@ public interface SearchRepository extends JpaRepository<Search, Long>, SearchRep
@Modifying
@Query("delete from Search s where s.member.id = :memberId and s.deletedAt is null")
void deleteAllByMemberId(Long memberId);

Optional<Search> findByMemberIdAndQueryAndDeletedAtIsNull(Long memberId, String query);
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public PlaceSearchListResponse searchPlace(HttpServletRequest httpServletRequest
Member loginMember = findLoginMember(httpServletRequest);
List<PlaceSearchResponse> placeSearchWithBookmark = this.updateSearchPlaceIsBookmark(loginMember, documents);
if (loginMember != null) {
this.updateSearchHistory(loginMember, request.getQuery());
this.updateSearchHistory(loginMember, request.getQuery().trim());
}
return PlaceSearchListResponse.of(placeSearchWithBookmark, result.getMeta().getIsEnd());
}
Expand Down Expand Up @@ -126,6 +126,11 @@ public void updateLikeCategory(Long memberId, LikeCategoryUpdateRequest request)
* @param query
*/
private void updateSearchHistory(Member loginMember, String query) {
Optional<Search> history = searchRepository.findByMemberIdAndQueryAndDeletedAtIsNull(loginMember.getId(), query);
if (history.isPresent()) {
history.get().modifyUpdateAt();
return;
}
int searchHistoryCount = searchRepository.countByMemberId(loginMember.getId());
// ๊ฒ€์ƒ‰๊ธฐ๋ก 20๊ฐœ ์ดˆ๊ณผ ์‹œ ๊ฐ€์žฅ ์˜ค๋ž˜๋œ ๊ฒ€์ƒ‰๊ธฐ๋ก ์‚ญ์ œ
if (searchHistoryCount >= SEARCH_HISTORY_MAX_COUNT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@Getter
public enum BookmarkSearchType {
ALL, WANT, GONE;
ALL, WANT, DONE;

public BookmarkType toBookmarkType() {
return BookmarkType.valueOf(this.name());
Expand Down

0 comments on commit f34af1b

Please sign in to comment.