Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion infra/sql/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ create table not_owned_search_history (
user_id bigint not null,
address varchar(255) not null,
title varchar(255) not null,
store_id varchar(255) not null,
is_crawled bit,
primary key (id)
) engine=InnoDB;

Expand All @@ -96,7 +98,7 @@ create table not_found_store (
id bigint not null auto_increment,
modified_at datetime(6),
address varchar(255) not null,
store_id varchar(255),
store_id varchar(255) not null,
title varchar(255) not null,
primary key (id)
) engine=InnoDB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public String getHomeRecommendTagImgUrl(Tag tag) {

private boolean isETCMenuPin(MenuPin pin) {
return pin.equals(MenuPin.TWO) || pin.equals(MenuPin.THREE) || pin.equals(MenuPin.FOUR) || pin.equals(
MenuPin.FIVE);
MenuPin.FIVE) || pin.equals(MenuPin.ETC);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public enum MenuPin {
TWO("2", "two"),
THREE("3", "three"),
FOUR("4", "four"),
FIVE("5", "five");
FIVE("5", "five"),
ETC("기타(십자)", "ETC");

private String name;
private String imgUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ private void saveSearchHistory(Long userId, GetStoreResponse getStoreResponse) {
NotOwnedMenuSearch notOwnedMenuSearch = NotOwnedMenuSearch.builder()
.title(getStoreResponse.getStoreTitle())
.address(getStoreResponse.getStoreAddress())
.storeId(getStoreResponse.getStoreId())
.isCrawled(getStoreResponse.isCrawled())
.userId(userId)
.build();
notOwnedMenuSearchRepository.save(notOwnedMenuSearch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -32,6 +31,12 @@ public class NotOwnedMenuSearch extends BaseEntity {
@NotNull
private String address;

@NotNull
private String storeId;

@NotNull
private boolean isCrawled;

@NotNull
private Long userId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ public class GetSearchHistoryResponse {

private String storeAddress;

private String storeId;

private boolean isCrawled;

private LocalDateTime modifiedAt;

public static GetSearchHistoryResponse from(NotOwnedMenuSearch notOwnedMenuSearch){
public static GetSearchHistoryResponse from(NotOwnedMenuSearch notOwnedMenuSearch) {
return GetSearchHistoryResponse.builder()
.menuTitle(notOwnedMenuSearch.getTitle())
.storeAddress(notOwnedMenuSearch.getAddress())
.storeId(notOwnedMenuSearch.getId().toString())
.isCrawled(false)
.modifiedAt(notOwnedMenuSearch.getModifiedAt())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class GetStoreResponse {
private List<GetStoreMenuResponse> menus;
private Double storeMapX;
private Double storeMapY;
private boolean isCrawled;

public static GetStoreResponse from(SearchableStore searchableStore) {
List<GetStoreMenuResponse> getStoreMenuResponses = searchableStore.getStoreMenus().stream()
Expand All @@ -40,6 +41,7 @@ public static GetStoreResponse from(SearchableStore searchableStore) {
.menus(getStoreMenuResponses)
.storeMapX(mapX)
.storeMapY(mapY)
.isCrawled(true)
.build();
}

Expand All @@ -50,6 +52,7 @@ public static GetStoreResponse from(NotFoundStore notFoundStore) {
.storeAddress(notFoundStore.getAddress())
.storeMapX(notFoundStore.getMapX())
.storeMapY(notFoundStore.getMapY())
.isCrawled(false)
.build();
}
}
Loading