diff --git a/backend/src/main/java/com/worlabel/domain/image/entity/dto/DetailImageResponse.java b/backend/src/main/java/com/worlabel/domain/image/entity/dto/DetailImageResponse.java index 36ccdd1..bf8b363 100644 --- a/backend/src/main/java/com/worlabel/domain/image/entity/dto/DetailImageResponse.java +++ b/backend/src/main/java/com/worlabel/domain/image/entity/dto/DetailImageResponse.java @@ -22,17 +22,17 @@ public class DetailImageResponse { private String imageUrl; @Schema(description = "폴리곤 데이터", example = "PENDING 상태라면 data null") - private String dataPath; + private String data; @Schema(description = "이미지 상태", example = "PENDING") private LabelStatus status; - public static DetailImageResponse from(final Image image) { + public static DetailImageResponse from(final Image image, final String data) { return new DetailImageResponse( image.getId(), image.getTitle(), image.getImagePath(), - image.getDataPath(), + data, image.getStatus() ); } diff --git a/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java b/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java index 2ec03f8..0619f8b 100644 --- a/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java +++ b/backend/src/main/java/com/worlabel/domain/image/service/ImageService.java @@ -40,7 +40,7 @@ public class ImageService { for (int order = 0; order < imageList.size(); order++) { MultipartFile file = imageList.get(order); String extension = getExtension(file); - String imageKey = s3UploadService.upload(file,extension, projectId); + String imageKey = s3UploadService.upload(file, extension, projectId); Image image = Image.of(file.getOriginalFilename(), imageKey, extension, order, folder); imageRepository.save(image); } @@ -53,8 +53,8 @@ public class ImageService { @Transactional(readOnly = true) public DetailImageResponse getImageById(final Integer projectId, final Integer folderId, final Long imageId, final Integer memberId) { Image image = getImageByIdAndFolderIdAndFolderProjectId(folderId, imageId, projectId); // 이미지가 해당 프로젝트에 속하는지 확인 -// String data = s3UploadService.getData(image.getDataPath()); - return DetailImageResponse.from(image); + String data = s3UploadService.getData(image.getDataPath()); + return DetailImageResponse.from(image, data); } /** diff --git a/backend/src/main/java/com/worlabel/domain/member/controller/MemberController.java b/backend/src/main/java/com/worlabel/domain/member/controller/MemberController.java index a862c42..7d8c4ae 100644 --- a/backend/src/main/java/com/worlabel/domain/member/controller/MemberController.java +++ b/backend/src/main/java/com/worlabel/domain/member/controller/MemberController.java @@ -1,15 +1,12 @@ package com.worlabel.domain.member.controller; -import com.worlabel.domain.member.entity.dto.MemberResponse; -import com.worlabel.domain.member.entity.dto.SearchMemberResponse; +import com.worlabel.domain.member.entity.dto.MemberDetailResponse; import com.worlabel.domain.member.service.MemberService; -import com.worlabel.domain.workspace.entity.dto.WorkspaceResponse; import com.worlabel.global.annotation.CurrentUser; import com.worlabel.global.config.swagger.SwaggerApiError; import com.worlabel.global.config.swagger.SwaggerApiSuccess; import com.worlabel.global.exception.ErrorCode; import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.data.repository.query.Param; @@ -31,7 +28,7 @@ public class MemberController { @SwaggerApiSuccess(description = "keyword가 포함된 사용자를 검색합니다.") @SwaggerApiError({ErrorCode.BAD_REQUEST, ErrorCode.NOT_AUTHOR, ErrorCode.SERVER_ERROR}) @GetMapping - public List getWorkspace( + public List getWorkspace( @CurrentUser final Integer memberId, @Param("keyword") final String keyword ) { diff --git a/backend/src/main/java/com/worlabel/domain/member/entity/dto/SearchMemberResponse.java b/backend/src/main/java/com/worlabel/domain/member/entity/dto/MemberDetailResponse.java similarity index 66% rename from backend/src/main/java/com/worlabel/domain/member/entity/dto/SearchMemberResponse.java rename to backend/src/main/java/com/worlabel/domain/member/entity/dto/MemberDetailResponse.java index 20f3d0d..c3db616 100644 --- a/backend/src/main/java/com/worlabel/domain/member/entity/dto/SearchMemberResponse.java +++ b/backend/src/main/java/com/worlabel/domain/member/entity/dto/MemberDetailResponse.java @@ -2,17 +2,14 @@ package com.worlabel.domain.member.entity.dto; import com.worlabel.domain.member.entity.Member; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.persistence.Entity; -import jakarta.persistence.Table; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.NoArgsConstructor; @Getter @AllArgsConstructor(access = AccessLevel.PRIVATE) -@Schema(name = "멤버 검색 DTO", description = "이메일 검색에 대한 응답 DTO") -public class SearchMemberResponse { +@Schema(name = "멤버 상세 DTO", description = "멤버 상세 응답 DTO") +public class MemberDetailResponse { @Schema(description = "ID", example = "1") private Integer id; @@ -25,7 +22,7 @@ public class SearchMemberResponse { @Schema(description = "이메일", example = "xxx@gmail.com") private String email; - public static SearchMemberResponse of(final Member member) { - return new SearchMemberResponse(member.getId(), member.getNickname(), member.getProfileImage(), member.getEmail()); + public static MemberDetailResponse of(final Member member) { + return new MemberDetailResponse(member.getId(), member.getNickname(), member.getProfileImage(), member.getEmail()); } } diff --git a/backend/src/main/java/com/worlabel/domain/member/service/MemberService.java b/backend/src/main/java/com/worlabel/domain/member/service/MemberService.java index 242746b..48f152e 100644 --- a/backend/src/main/java/com/worlabel/domain/member/service/MemberService.java +++ b/backend/src/main/java/com/worlabel/domain/member/service/MemberService.java @@ -2,7 +2,7 @@ package com.worlabel.domain.member.service; import com.worlabel.domain.member.entity.Member; import com.worlabel.domain.member.entity.dto.MemberResponse; -import com.worlabel.domain.member.entity.dto.SearchMemberResponse; +import com.worlabel.domain.member.entity.dto.MemberDetailResponse; import com.worlabel.domain.member.repository.MemberRepository; import com.worlabel.global.exception.CustomException; import com.worlabel.global.exception.ErrorCode; @@ -32,10 +32,10 @@ public class MemberService { return MemberResponse.of(member); } - public List getSearchMember(final Integer memberId, final String keyword) { + public List getSearchMember(final Integer memberId, final String keyword) { return memberRepository.findAllByKeyword(memberId, keyword.isEmpty() ? null : keyword) .stream() - .map(SearchMemberResponse::of) + .map(MemberDetailResponse::of) .toList(); } } diff --git a/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewDetailResponse.java b/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewDetailResponse.java index 01cf728..d628d1d 100644 --- a/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewDetailResponse.java +++ b/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewDetailResponse.java @@ -2,7 +2,7 @@ package com.worlabel.domain.review.entity.dto; import com.worlabel.domain.image.entity.dto.ImageResponse; import com.worlabel.domain.member.entity.Member; -import com.worlabel.domain.member.entity.dto.MemberResponse; +import com.worlabel.domain.member.entity.dto.MemberDetailResponse; import com.worlabel.domain.review.entity.Review; import com.worlabel.domain.review.entity.ReviewStatus; import io.swagger.v3.oas.annotations.media.Schema; @@ -41,10 +41,10 @@ public class ReviewDetailResponse { private LocalDateTime updateAt; @Schema(description = "작성자 정보", example = "") - private MemberResponse author; + private MemberDetailResponse author; @Schema(description = "리뷰어 정보", example = "") - private MemberResponse reviewer; + private MemberDetailResponse reviewer; public static ReviewDetailResponse of(final Review review, final List images) { Member writer = review.getMember(); @@ -57,8 +57,8 @@ public class ReviewDetailResponse { images, review.getCreatedAt(), review.getUpdatedAt(), - MemberResponse.of(writer), - Optional.ofNullable(reviewer).map(MemberResponse::of).orElse(null) + MemberDetailResponse.of(writer), + Optional.ofNullable(reviewer).map(MemberDetailResponse::of).orElse(null) ); } diff --git a/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewResponse.java b/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewResponse.java index 8b8d1e4..0e7f62a 100644 --- a/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewResponse.java +++ b/backend/src/main/java/com/worlabel/domain/review/entity/dto/ReviewResponse.java @@ -1,5 +1,6 @@ package com.worlabel.domain.review.entity.dto; +import com.worlabel.domain.member.entity.dto.MemberDetailResponse; import com.worlabel.domain.review.entity.Review; import com.worlabel.domain.review.entity.ReviewStatus; import io.swagger.v3.oas.annotations.media.Schema; @@ -29,11 +30,8 @@ public class ReviewResponse { @Schema(description = "리뷰 상태", example = "요청") private ReviewStatus status; - @Schema(description = "작성자 닉네임", example = "javajoha") - private String nickname; - - @Schema(description = "작성자 이메일", example = "jaa@naver.com") - private String email; + @Schema(description = "작성자 정보", example = "") + private MemberDetailResponse author; @Schema(description = "리뷰 작성일", example = "") private LocalDateTime createAt; @@ -48,8 +46,7 @@ public class ReviewResponse { review.getTitle(), review.getContent(), review.getReviewStatus(), - review.getMember().getNickname(), - review.getMember().getEmail(), + MemberDetailResponse.of(review.getMember()), review.getCreatedAt(), review.getUpdatedAt()); } diff --git a/backend/src/main/java/com/worlabel/domain/workspace/controller/WorkspaceController.java b/backend/src/main/java/com/worlabel/domain/workspace/controller/WorkspaceController.java index 8946376..1d38b27 100644 --- a/backend/src/main/java/com/worlabel/domain/workspace/controller/WorkspaceController.java +++ b/backend/src/main/java/com/worlabel/domain/workspace/controller/WorkspaceController.java @@ -1,10 +1,8 @@ package com.worlabel.domain.workspace.controller; import com.worlabel.domain.member.entity.dto.MemberResponse; -import com.worlabel.domain.project.entity.dto.ProjectMemberResponse; import com.worlabel.domain.review.entity.dto.ReviewResponse; import com.worlabel.domain.review.entity.dto.ReviewStatusRequest; -import com.worlabel.domain.workspace.entity.dto.WorkspaceMemberResponse; import com.worlabel.domain.workspace.entity.dto.WorkspaceRequest; import com.worlabel.domain.workspace.entity.dto.WorkspaceResponse; import com.worlabel.domain.workspace.entity.dto.WorkspaceResponses; diff --git a/backend/src/main/java/com/worlabel/domain/workspace/service/WorkspaceService.java b/backend/src/main/java/com/worlabel/domain/workspace/service/WorkspaceService.java index 577b37d..6b626e5 100644 --- a/backend/src/main/java/com/worlabel/domain/workspace/service/WorkspaceService.java +++ b/backend/src/main/java/com/worlabel/domain/workspace/service/WorkspaceService.java @@ -6,12 +6,10 @@ import com.worlabel.domain.member.repository.MemberRepository; import com.worlabel.domain.participant.entity.WorkspaceParticipant; import com.worlabel.domain.participant.repository.WorkspaceParticipantRepository; import com.worlabel.domain.review.entity.Review; -import com.worlabel.domain.review.entity.ReviewStatus; import com.worlabel.domain.review.entity.dto.ReviewResponse; import com.worlabel.domain.review.entity.dto.ReviewStatusRequest; import com.worlabel.domain.review.repository.ReviewRepository; import com.worlabel.domain.workspace.entity.Workspace; -import com.worlabel.domain.workspace.entity.dto.WorkspaceMemberResponse; import com.worlabel.domain.workspace.entity.dto.WorkspaceRequest; import com.worlabel.domain.workspace.entity.dto.WorkspaceResponse; import com.worlabel.domain.workspace.repository.WorkspaceRepository;