diff --git a/server/src/main/java/com/talkka/server/bookmark/dao/BookmarkDetailEntity.java b/server/src/main/java/com/talkka/server/bookmark/dao/BookmarkDetailEntity.java index 83670fcd..35f5fb2c 100644 --- a/server/src/main/java/com/talkka/server/bookmark/dao/BookmarkDetailEntity.java +++ b/server/src/main/java/com/talkka/server/bookmark/dao/BookmarkDetailEntity.java @@ -5,12 +5,14 @@ import org.springframework.data.annotation.CreatedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import com.talkka.server.bookmark.enums.BookmarkDetailType; +import com.talkka.server.bookmark.enums.TransportType; import com.talkka.server.subway.enums.Updown; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; @@ -37,8 +39,8 @@ public class BookmarkDetailEntity { private Integer seq; @Column(name = "type", nullable = false, length = 10) - // @Convert(converter = BookmarkDetailType.class) - private BookmarkDetailType type; + @Enumerated(EnumType.STRING) + private TransportType type; @ManyToOne @JoinColumn(name = "bookmark_id") diff --git a/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailCreateDto.java b/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailCreateDto.java index 547578e8..61bc1170 100644 --- a/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailCreateDto.java +++ b/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailCreateDto.java @@ -2,12 +2,12 @@ import com.talkka.server.bookmark.dao.BookmarkDetailEntity; import com.talkka.server.bookmark.dao.BookmarkEntity; -import com.talkka.server.bookmark.enums.BookmarkDetailType; +import com.talkka.server.bookmark.enums.TransportType; import com.talkka.server.subway.enums.Updown; public record BookmarkDetailCreateDto( Integer seq, - BookmarkDetailType type, + TransportType type, Long subwayStationId, Updown subwayUpdown, Long busRouteStationId diff --git a/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailRespDto.java b/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailRespDto.java index 5503dbdd..5493c092 100644 --- a/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailRespDto.java +++ b/server/src/main/java/com/talkka/server/bookmark/dao/dto/BookmarkDetailRespDto.java @@ -1,12 +1,12 @@ package com.talkka.server.bookmark.dao.dto; import com.talkka.server.bookmark.dao.BookmarkDetailEntity; -import com.talkka.server.bookmark.enums.BookmarkDetailType; +import com.talkka.server.bookmark.enums.TransportType; import com.talkka.server.subway.enums.Updown; public record BookmarkDetailRespDto( Integer seq, - BookmarkDetailType type, + TransportType type, Long subwayStationId, Updown subwayUpdown, Long busRouteStationId diff --git a/server/src/main/java/com/talkka/server/bookmark/enums/BookmarkDetailType.java b/server/src/main/java/com/talkka/server/bookmark/enums/BookmarkDetailType.java deleted file mode 100644 index 9748adc7..00000000 --- a/server/src/main/java/com/talkka/server/bookmark/enums/BookmarkDetailType.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.talkka.server.bookmark.enums; - -import com.talkka.server.common.util.EnumCodeInterface; - -import lombok.Getter; - -@Getter -public enum BookmarkDetailType implements EnumCodeInterface { - // 0: 버스, 1: 지하철 - BUS("0"), SUBWAY("1"); - - private final String code; - - BookmarkDetailType(String code) { - this.code = code; - } -} diff --git a/server/src/main/java/com/talkka/server/bookmark/enums/TransportType.java b/server/src/main/java/com/talkka/server/bookmark/enums/TransportType.java new file mode 100644 index 00000000..6439b174 --- /dev/null +++ b/server/src/main/java/com/talkka/server/bookmark/enums/TransportType.java @@ -0,0 +1,8 @@ +package com.talkka.server.bookmark.enums; + +import lombok.Getter; + +@Getter +public enum TransportType { + BUS, SUBWAY +}