Skip to content

Commit 76852a6

Browse files
committed
feat(volunteer): 커뮤니티 조회에 사용할 ResponseDto 생성
1 parent b88355f commit 76852a6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.somemore.volunteer.dto.response;
2+
3+
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
4+
import com.fasterxml.jackson.databind.annotation.JsonNaming;
5+
import com.somemore.community.dto.response.WriterDetailDto;
6+
import com.somemore.volunteer.domain.Tier;
7+
import com.somemore.volunteer.domain.Volunteer;
8+
9+
import java.util.UUID;
10+
11+
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
12+
public record VolunteerForCommunityResponseDto(
13+
UUID id,
14+
String name,
15+
String imgUrl,
16+
Tier tier
17+
) implements WriterDetailDto {
18+
19+
public static VolunteerForCommunityResponseDto fromEntity(Volunteer volunteer) {
20+
return new VolunteerForCommunityResponseDto(
21+
volunteer.getId(),
22+
volunteer.getNickname(),
23+
volunteer.getImgUrl(),
24+
volunteer.getTier()
25+
);
26+
}
27+
}
28+

0 commit comments

Comments
 (0)