File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed
src/main/java/com/somemore/community/dto/response Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .somemore .community .dto .response ;
2+
3+ import com .fasterxml .jackson .databind .PropertyNamingStrategies ;
4+ import com .fasterxml .jackson .databind .annotation .JsonNaming ;
5+ import com .somemore .community .domain .CommunityBoard ;
6+
7+ import java .time .LocalDateTime ;
8+
9+ @ JsonNaming (PropertyNamingStrategies .SnakeCaseStrategy .class )
10+ public record CommunityBoardGetDetailResponseDto (
11+ Long id ,
12+ String title ,
13+ String content ,
14+ String imageUrl ,
15+ LocalDateTime createdAt ,
16+ LocalDateTime updatedAt ,
17+ WriterDetailDto writerDetailDto
18+ ) {
19+ public static CommunityBoardGetDetailResponseDto fromEntity (CommunityBoard board , WriterDetailDto writer ) {
20+ return new CommunityBoardGetDetailResponseDto (
21+ board .getId (),
22+ board .getTitle (),
23+ board .getContent (),
24+ board .getImgUrl (),
25+ board .getCreatedAt (),
26+ board .getUpdatedAt (),
27+ writer
28+ );
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ package com .somemore .community .dto .response ;
2+
3+ import com .fasterxml .jackson .databind .PropertyNamingStrategies .SnakeCaseStrategy ;
4+ import com .fasterxml .jackson .databind .annotation .JsonNaming ;
5+ import com .somemore .community .domain .CommunityBoard ;
6+
7+ import java .time .LocalDateTime ;
8+
9+ @ JsonNaming (SnakeCaseStrategy .class )
10+ public record CommunityBoardGetResponseDto (
11+ Long id ,
12+ String title ,
13+ String writerNickname ,
14+ LocalDateTime createdAt
15+ ) {
16+ public static CommunityBoardGetResponseDto fromEntity (CommunityBoard board , String writerNickname ) {
17+ return new CommunityBoardGetResponseDto (
18+ board .getId (),
19+ board .getTitle (),
20+ writerNickname ,
21+ board .getCreatedAt ()
22+ );
23+ }
24+ }
25+
Original file line number Diff line number Diff line change 1+ package com .somemore .community .dto .response ;
2+
3+ import com .somemore .volunteer .domain .Tier ;
4+
5+ import java .util .UUID ;
6+
7+ public interface WriterDetailDto {
8+ UUID id ();
9+ String name ();
10+ String imgUrl ();
11+ Tier tier ();
12+ }
You can’t perform that action at this time.
0 commit comments