Skip to content

Commit 6ead2b3

Browse files
committed
fix: Entity 컬럼명 수정, request spotifyId 값 String 타입으로 반환 및 response spotifyId 값 Long 타입으로 반환하도록 수정, 상세 페이지 response에 longinId(태그 값) 추가 #3
1 parent 492e162 commit 6ead2b3

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

src/main/java/org/dfbf/soundlink/domain/emotionRecord/dto/request/EmotionRecordRequestDTO.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
import jakarta.validation.constraints.Size;
66
import org.dfbf.soundlink.global.comm.enums.Emotions;
77

8-
import java.sql.Timestamp;
9-
108
public record EmotionRecordRequestDTO(
119

1210
@NotNull(message = "spotifyId 필요")
13-
Long spotifyId,
11+
String spotifyId,
1412

1513
@NotBlank(message = "title 필요")
1614
String title,
@@ -25,8 +23,6 @@ public record EmotionRecordRequestDTO(
2523

2624
@NotBlank(message = "comment 필요")
2725
@Size(max = 200, message = "comment는 200자 이내여야 합니다.")
28-
String comment,
29-
30-
Timestamp createAt
26+
String comment
3127
) {
3228
}

src/main/java/org/dfbf/soundlink/domain/emotionRecord/dto/request/EmotionRecordUpdateRequestDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.dfbf.soundlink.domain.emotionRecord.dto.request;
22

33
public record EmotionRecordUpdateRequestDTO(
4-
Long spotifyId,
4+
String spotifyId,
55
String title,
66
String artist,
77
String albumImage,

src/main/java/org/dfbf/soundlink/domain/emotionRecord/dto/response/EmotionRecordResponseWithOwnerDTO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
public record EmotionRecordResponseWithOwnerDTO(
99
Long recordId,
1010
String nickName,
11+
String loginId,
1112
String emotion,
1213
SpotifyMusicResponseDTO spotifyMusic,
1314
String comment,
@@ -18,6 +19,7 @@ public static EmotionRecordResponseWithOwnerDTO fromEntity(EmotionRecord record,
1819
return new EmotionRecordResponseWithOwnerDTO(
1920
record.getRecordId(),
2021
record.getUser().getNickname(),
22+
record.getUser().getLoginId(),
2123
record.getEmotion().name(),
2224
record.getSpotifyMusic() != null ? SpotifyMusicResponseDTO.fromEntity(record.getSpotifyMusic()) : null,
2325
record.getComment(),

src/main/java/org/dfbf/soundlink/domain/emotionRecord/dto/response/EmotionRecordUpdateResponseDTO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public record EmotionRecordUpdateResponseDTO(
66
Long recordId,
7-
String spotifyId,
7+
Long spotifyId,
88
String title,
99
String artist,
1010
String albumImage,
@@ -14,7 +14,7 @@ public record EmotionRecordUpdateResponseDTO(
1414
public static EmotionRecordUpdateResponseDTO fromEntity(EmotionRecord record) {
1515
return new EmotionRecordUpdateResponseDTO(
1616
record.getRecordId(),
17-
String.valueOf(record.getSpotifyMusic().getSpotifyId()),
17+
record.getSpotifyMusic().getSpotifyId(),
1818
record.getSpotifyMusic().getTitle(),
1919
record.getSpotifyMusic().getArtist(),
2020
record.getSpotifyMusic().getAlbumImage(),

src/main/java/org/dfbf/soundlink/domain/emotionRecord/dto/response/SpotifyMusicResponseDTO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import org.dfbf.soundlink.domain.emotionRecord.entity.SpotifyMusic;
44

5-
public record SpotifyMusicResponseDTO(String spotifyId, String title, String artist, String albumImage) {
5+
public record SpotifyMusicResponseDTO(Long spotifyId, String title, String artist, String albumImage) {
66
public static SpotifyMusicResponseDTO fromEntity(SpotifyMusic music) {
77
return new SpotifyMusicResponseDTO(
8-
String.valueOf(music.getSpotifyId()),
8+
music.getSpotifyId(),
99
music.getTitle(),
1010
music.getArtist(),
1111
music.getAlbumImage()

src/main/java/org/dfbf/soundlink/domain/emotionRecord/entity/EmotionRecord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class EmotionRecord {
2828
private Emotions emotion;
2929

3030
@ManyToOne
31-
@JoinColumn(name = "spotify_music_id")
31+
@JoinColumn(name = "spotify_id")
3232
private SpotifyMusic spotifyMusic;
3333

3434
@Column(name = "comment")

0 commit comments

Comments
 (0)