Skip to content

Commit ad0fbbd

Browse files
committed
refactor: DTO Schema 추가
1 parent b36ffc2 commit ad0fbbd

10 files changed

Lines changed: 76 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.request;
22

33
import com.back.web7_9_codecrete_be.domain.artists.entity.ArtistType;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45
import jakarta.validation.constraints.NotBlank;
56
import jakarta.validation.constraints.NotNull;
67
import jakarta.validation.constraints.Size;
78

89
public record CreateRequest(
910
@NotBlank(message = "아티스트 이름은 필수로 입력해야합니다.")
1011
@Size(max = 200, message = "아티스트 이름은 200자를 넘길 수 없습니다.")
12+
@Schema(description = "아티스트 이름입니다.")
1113
String artistName,
1214

1315
@Size(max = 150, message = "아티스트 그룹 이름은 150자를 넘길 수 없습니다.")
16+
@Schema(description = "아티스트 소속 그룹입니다. 아티스트 이름이 그룹인 경우, null 로 처리됩니다.")
1417
String artistGroup,
1518

1619
@NotNull(message = "아티스트 타입은 필수로 입력해야합니다(SOLO or GROUP)")
20+
@Schema(description = "아티스트 타입입니다.", example = "SOLO or GROUP")
1721
ArtistType artistType,
1822

1923
@NotBlank(message = "장르는 필수로 입력해야합니다.")
2024
@Size(max = 30, message = "장르는 30자를 넘길 수 없습니다.")
25+
@Schema(description = "장르 이름입니다.")
2126
String genreName
2227
) {
2328
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.request;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import jakarta.validation.constraints.NotBlank;
45
import jakarta.validation.constraints.Size;
56

67
public record SearchRequest(
78
@NotBlank(message = "검색어를 입력해주세요")
89
@Size(max = 200, message = "아티스트 이름은 200자를 넘길 수 없습니다.")
10+
@Schema(description = "아티스트 이름입니다.")
911
String artistName
1012
) {
1113
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.request;
22

33
import com.back.web7_9_codecrete_be.domain.artists.entity.ArtistType;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45
import jakarta.validation.constraints.Size;
56

67
public record UpdateRequest(
78
@Size(max = 200, message = "아티스트 이름은 200자를 넘길 수 없습니다.")
9+
@Schema(description = "아티스트 이름입니다.")
810
String artistName,
911

1012
@Size(max = 150, message = "아티스트 그룹 이름은 150자를 넘길 수 없습니다.")
13+
@Schema(description = "아티스트 소속 그룹입니다. 아티스트 이름이 그룹인 경우, null 로 처리됩니다.")
1114
String artistGroup,
1215

16+
@Schema(description = "아티스트 타입입니다.", example = "SOLO or GROUP")
1317
ArtistType artistType,
1418

1519
@Size(max = 30, message = "장르 이름은 30자를 넘길 수 없습니다.")
20+
@Schema(description = "장르 이름입니다.")
1621
String genreName
1722
) {
1823
}
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record AlbumResponse(
6+
@Schema(description = "앨범 이름입니다.")
47
String albumName,
8+
9+
@Schema(description = "앨범 발매일입니다.", format = "yyyy-MM-dd")
510
String releaseDate,
6-
String albumType, // album / single / ep
11+
12+
@Schema(description = "앨범 타입입니다.", example = "album or single or ep")
13+
String albumType,
14+
15+
@Schema(description = "앨범 이미지 URL 입니다.")
716
String imageUrl,
17+
18+
@Schema(description = "앨범 Spotify URL 입니다.")
819
String spotifyUrl
920
) {
1021
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

33
import com.back.web7_9_codecrete_be.domain.artists.entity.ArtistType;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45

56
import java.util.List;
67

78
public record ArtistDetailResponse(
9+
@Schema(description = "아티스트 이름입니다.")
810
String artistName,
11+
12+
@Schema(description = "아티스트 소속 그룹입니다. 아티스트 이름이 그룹인 경우, null 로 처리됩니다.")
913
String artistGroup,
14+
15+
@Schema(description = "아티스트 타입입니다.", example = "SOLO or GROUP")
1016
ArtistType artistType,
17+
18+
@Schema(description = "아티스트 프로필 이미지 URL 입니다.")
1119
String profileImageUrl,
20+
21+
@Schema(description = "받은 총 좋아요 수(찜한 수) 입니다.")
1222
long likeCount,
23+
24+
@Schema(description = "아티스트의 총 앨범 수 입니다.")
1325
int totalAlbums,
26+
27+
@Schema(description = "아티스트의 인기도 입니다.(Spotify 기준입니다.)")
1428
double popularityRating,
29+
30+
@Schema(description = "아티스트에 대한 설명입니다.")
1531
String description,
32+
33+
@Schema(description = "아티스트가 발매한 앨범 리스트입니다.")
1634
List<AlbumResponse> albums,
35+
36+
@Schema(description = "아티스트의 가장 인기 있는 트랙 상위 10개입니다.")
1737
List<TopTrackResponse> topTracks,
38+
39+
@Schema(description = "아티스트와 관련 있는 다른 아티스트 목록입니다.")
1840
List<RelatedArtistResponse> relatedArtists
1941
) {
2042
}

src/main/java/com/back/web7_9_codecrete_be/domain/artists/dto/response/ArtistListResponse.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

33
import com.back.web7_9_codecrete_be.domain.artists.entity.Artist;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45

56
public record ArtistListResponse(
7+
@Schema(description = "아티스트 이름입니다.")
68
String artistName,
9+
10+
@Schema(description = "아티스트 소속 그룹입니다. 아티스트 이름이 그룹인 경우, null 로 처리됩니다.")
711
String artistGroup,
12+
13+
@Schema(description = "장르 이름입니다.")
814
String genreName
915
) {
1016
public static ArtistListResponse from(Artist artist) {

src/main/java/com/back/web7_9_codecrete_be/domain/artists/dto/response/ConcertListByArtistResponse.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

33
import com.back.web7_9_codecrete_be.domain.concerts.entity.Concert;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45

56
import java.time.LocalDate;
67

78
public record ConcertListByArtistResponse(
9+
@Schema(description = "공연명 입니다.")
810
String concertName,
11+
12+
@Schema(description = "공연 시작 날짜입니다.", format = "yyyy-MM-dd")
913
LocalDate startDate,
14+
15+
@Schema(description = "공연 장소입니다.")
1016
String concertPlace
1117
) {
1218
public static ConcertListByArtistResponse from(Concert concert) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record RelatedArtistResponse(
6+
@Schema(description = "아티스트 이름입니다.")
47
String artistName,
8+
9+
@Schema(description = "아티스트 사진 URL 입니다.")
510
String imageUrl,
11+
12+
@Schema(description = "아티스트의 Spotify id 입니다.")
613
String spotifyArtistId
714
) {
815
}

src/main/java/com/back/web7_9_codecrete_be/domain/artists/dto/response/SearchResponse.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

33
import com.back.web7_9_codecrete_be.domain.artists.entity.Artist;
4+
import io.swagger.v3.oas.annotations.media.Schema;
45

56
public record SearchResponse(
7+
@Schema(description = "아티스트 이름입니다.")
68
String artistName,
9+
10+
@Schema(description = "아티스트 소속 그룹입니다. 아티스트 이름이 그룹인 경우, null 로 처리됩니다.")
711
String artistGroup,
12+
13+
@Schema(description = "받은 총 좋아요 수(찜한 수) 입니다.")
814
int likeCount
915
) {
1016
public static SearchResponse from(Artist artist) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package com.back.web7_9_codecrete_be.domain.artists.dto.response;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
35
public record TopTrackResponse(
6+
@Schema(description = "노래 제목입니다.")
47
String trackName,
8+
9+
@Schema(description = "노래의 Spotify URL 입니다.")
510
String spotifyUrl
611
) {
712
}

0 commit comments

Comments
 (0)