Skip to content

Commit

Permalink
refactor: dto 변수명 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Nov 19, 2024
1 parent 77f2850 commit b19abcf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface ReceiptMapper {

List<ReceiptDTO.Response> to(List<Receipt> account);

ReceiptDTO.Response to(Receipt receipt, List<FileResponse> files);
ReceiptDTO.Response to(Receipt receipt, List<FileResponse> fileUrls);

@Mapping(target = "id", ignore = true)
@Mapping(target = "description", source = "dto.description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface NoticeMapper {
@Mapping(target = "comments", expression = "java(filterParentComments(notice.getComments()))"),
@Mapping(target = "time", source = "notice.modifiedAt")
})
NoticeDTO.Response toNoticeDto(Notice notice, List<FileResponse> files);
NoticeDTO.Response toNoticeDto(Notice notice, List<FileResponse> fileUrls);

default List<CommentDTO.Response> filterParentComments(List<Comment> comments) {
if (comments == null || comments.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface PostMapper {
@Mapping(target = "comments", expression = "java(filterParentComments(post.getComments()))"),
@Mapping(target = "time", source = "post.modifiedAt")
})
PostDTO.Response toPostDto(Post post, List<FileResponse> files);
PostDTO.Response toPostDto(Post post, List<FileResponse> fileUrls);

default List<CommentDTO.Response> filterParentComments(List<Comment> comments) {
if (comments == null || comments.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, uses = CommentMapper.class, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface FileMapper {

@Mapping(target = "id", ignore = true)
@Mapping(target = "post", source = "post")
File toFile(String fileName, String fileUrl, Post post);

@Mapping(target = "id", ignore = true)
@Mapping(target = "notice", source = "notice")
File toFile(String fileName, String fileUrl, Notice notice);

@Mapping(target = "id", ignore = true)
@Mapping(target = "receipt", source = "receipt")
File toFile(String fileName, String fileUrl, Receipt receipt);

Expand Down

0 comments on commit b19abcf

Please sign in to comment.