Skip to content

Commit 20ca50d

Browse files
committed
test(VolunteerResponseDto): 봉사자 응답 정보 스웨거 어노테이션 추가
1 parent 29a621b commit 20ca50d

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

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

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
package com.somemore.volunteer.dto.response;
22

3+
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
4+
import com.fasterxml.jackson.databind.annotation.JsonNaming;
35
import com.somemore.volunteer.domain.Volunteer;
46
import com.somemore.volunteer.domain.VolunteerDetail;
7+
import io.swagger.v3.oas.annotations.media.Schema;
58

9+
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
10+
@Schema(description = "봉사자 응답 DTO")
611
public record VolunteerResponseDto(
12+
@Schema(description = "봉사자 ID", example = "123e4567-e89b-12d3-a456-426614174000")
713
String volunteerId,
14+
15+
@Schema(description = "봉사자 닉네임", example = "길동이")
816
String nickname,
17+
18+
@Schema(description = "봉사자 이미지 URL", example = "http://example.com/image.jpg")
919
String imgUrl,
20+
21+
@Schema(description = "봉사자 소개", example = "안녕하세요! 봉사 활동을 좋아합니다.")
1022
String introduce,
23+
24+
@Schema(description = "봉사자 등급", example = "RED")
1125
String tier,
26+
27+
@Schema(description = "총 봉사 시간", example = "120")
1228
Integer totalVolunteerHours,
29+
30+
@Schema(description = "총 봉사 횟수", example = "20")
1331
Integer totalVolunteerCount,
32+
33+
@Schema(description = "봉사자 상세 정보", implementation = VolunteerDetailResponseDto.class)
1434
VolunteerDetailResponseDto volunteerDetailResponseDto
1535
) {
1636

@@ -45,11 +65,22 @@ public static VolunteerResponseDto from(
4565
);
4666
}
4767

68+
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
69+
@Schema(description = "봉사자 상세 응답 DTO")
4870
private record VolunteerDetailResponseDto(
71+
@Schema(description = "이름", example = "홍길동")
4972
String name,
73+
74+
@Schema(description = "이메일", example = "[email protected]")
5075
String email,
76+
77+
@Schema(description = "성별", example = "MALE")
5178
String gender,
79+
80+
@Schema(description = "생년월일", example = "1990-01-01")
5281
String birthDate,
82+
83+
@Schema(description = "연락처", example = "010-1234-5678")
5384
String contactNumber
5485
) {
5586
public static VolunteerDetailResponseDto from(
@@ -64,8 +95,4 @@ public static VolunteerDetailResponseDto from(
6495
);
6596
}
6697
}
67-
68-
6998
}
70-
71-

0 commit comments

Comments
 (0)