Skip to content

Commit

Permalink
feat : TransportType enum 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyaak committed Aug 16, 2024
1 parent f6f57e7 commit aa37ae0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.talkka.server.bookmark.enums;

import lombok.Getter;

@Getter
public enum TransportType {
BUS, SUBWAY
}

0 comments on commit aa37ae0

Please sign in to comment.