Skip to content

Commit 0801d5e

Browse files
committed
refactor(VolunteerProfileResponseDto): 내부 private record를 VolunteerDetailProfileResponseDto에서 'detail'로 변경
- API 명세에 맞게 응답 값을 수정 - 내부 private record 이므로 과감한 네이밍 개선
1 parent 8ce6885 commit 0801d5e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/java/com/somemore/volunteer/dto/response/VolunteerProfileResponseDto.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public record VolunteerProfileResponseDto(
3030
@Schema(description = "총 봉사 횟수", example = "20")
3131
Integer totalVolunteerCount,
3232

33-
@Schema(description = "봉사자 상세 정보", implementation = VolunteerDetailProfileResponseDto.class)
34-
VolunteerDetailProfileResponseDto volunteerDetailProfileResponseDto
33+
@Schema(description = "봉사자 상세 정보", implementation = Detail.class)
34+
Detail detail
3535
) {
3636

3737
public static VolunteerProfileResponseDto from(
@@ -46,7 +46,7 @@ public static VolunteerProfileResponseDto from(
4646
volunteer.getTier().name(),
4747
volunteer.getTotalVolunteerHours(),
4848
volunteer.getTotalVolunteerCount(),
49-
VolunteerDetailProfileResponseDto.from(volunteerDetail)
49+
Detail.from(volunteerDetail)
5050
);
5151
}
5252

@@ -66,8 +66,8 @@ public static VolunteerProfileResponseDto from(
6666
}
6767

6868
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
69-
@Schema(description = "봉사자 상세 프로필 응답 DTO")
70-
private record VolunteerDetailProfileResponseDto(
69+
@Schema(description = "봉사자 상세 프로필")
70+
private record Detail(
7171
@Schema(description = "이름", example = "홍길동")
7272
String name,
7373

@@ -83,10 +83,10 @@ private record VolunteerDetailProfileResponseDto(
8383
@Schema(description = "연락처", example = "010-1234-5678")
8484
String contactNumber
8585
) {
86-
public static VolunteerDetailProfileResponseDto from(
86+
public static Detail from(
8787
VolunteerDetail volunteerDetail
8888
) {
89-
return new VolunteerDetailProfileResponseDto(
89+
return new Detail(
9090
volunteerDetail.getName(),
9191
volunteerDetail.getEmail(),
9292
volunteerDetail.getGender().name(),

src/test/java/com/somemore/volunteer/service/VolunteerQueryServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void getVolunteerProfile() {
129129
assertThat(response).isNotNull();
130130
assertThat(response.volunteerId()).isEqualTo(volunteerId.toString());
131131
assertThat(response.nickname()).isEqualTo(volunteer.getNickname());
132-
assertThat(response.volunteerDetailProfileResponseDto()).isNull();
132+
assertThat(response.detail()).isNull();
133133
}
134134

135135
@DisplayName("권한이 없는 기관의 봉사자 상세 프로필 조회 실패")

0 commit comments

Comments
 (0)