Skip to content

Commit

Permalink
Hotfix : 작성자 프로필 정보 추가 (#160)
Browse files Browse the repository at this point in the history
* 🐛 Hotfix: 댓글 수정 request dto 추가 (#149)

* Hotfix : 댓글 삭제 시 게시물의 댓글 수 차감 로직 수정 (#151)

* 🐛 Hotfix: 댓글 수정 request dto 추가

* 🐛 Hotfix: 댓글 삭제 시 게시물의 댓글 수 차감 로직 수정

* Feat: 프로필 이모지 설정 로직 구현 (#153)

* 🗃️ profile 속성의 Enum value ProfileEmoji 생성

* 🗃️ profile 속성 ProfileEmoji 설정

* ✨ Feat: 회원 가입 및 정보 수정에 프로필 이모지 설정 로직 추가

* Refactor : 모델 삭제 시 soft delete 구현 (#155)

* 🗃️ versionStatus 속성의 Enum value VersionStatus 생성

* 🗃️ versionStatus 속성 추가

* 👔 모델 삭제 시 sofe delete 구현

* 👔 모델 삭제 시 sofe delete 구현

* Fix: 타 사용자 자소서 조회 시 포인트 사용 로직 수정 (#157)

* 🗃️ coverletter 외래키 추가

* 👔 자소서 조회 포인트 사용 시, point 데이터에 coverletter 삽입 로직 추가

* 👔 자소서 상세 조회 시 포인트를 사용한 자소서인지 나타내는 변수 추가

* Refactor: 댓글 대댓글 계층 구조 적용 (#158)

* 🗃️ 댓글 계층 구조 나타내는 속성 추가

* 🗃️ db 변경 사항에 따른 댓글 작성 로직 수정

* 👔 db 변경 사항에 따른 댓글 목록 조회 로직 수정

* 🔥 필요 없는 메소드 삭제

* 👔 비활성/탈퇴 회원 제거 로직 추가

* 🐛 게시물 작성자 프로필 추가

* 🐛 자기소개서 작성자 정보 추가

* 🐛 경험카드 작성자 정보 추가
  • Loading branch information
joowojr authored May 21, 2024
1 parent 60af4bf commit 3412b4b
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public static class BoardItem {
@Schema(description = "게시글 작성자")
private String memberName;

@Schema(description = "작성자 프로필")
private String profile;

@Schema(description = "게시글 제목")
private String title;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.web.bind.annotation.*;

import static com.codez4.meetfolio.domain.coverLetter.dto.CoverLetterResponse.toCoverLetterListResult;
import static com.codez4.meetfolio.domain.coverLetter.dto.CoverLetterResponse.toOtherMemberCoverLetterListResult;

@Tag(name = "자기소개서 API")
@RestController
Expand Down Expand Up @@ -103,13 +104,14 @@ public ApiResponse<CoverLetterResponse.CoverLetterListResult> getMyCoverLetters(
@Operation(summary = "다른 사용자의 자기소개서 목록 조회", description = "타 사용자의 자기소개서 목록 정보를 조회합니다.")
@Parameter(name = "page", description = "페이징 번호, page, Query String입니다.", example = "0", in = ParameterIn.QUERY)
@PostMapping("/members")
public ApiResponse<CoverLetterResponse.CoverLetterListResult> getOtherCoverLetters(
public ApiResponse<CoverLetterResponse.OtherMemberCoverLetterListResult> getOtherCoverLetters(
@AuthenticationMember Member member,
@RequestParam String memberName,
@RequestParam(value = "page", defaultValue = "0") int page) {
MemberInfo memberInfo = MemberResponse.toMemberInfo(member);
Member other = memberQueryService.findByMemberName(memberName);
return ApiResponse.onSuccess(toCoverLetterListResult(memberInfo,coverLetterQueryService.getOtherCoverLetters(other, page)));
return ApiResponse.onSuccess(toOtherMemberCoverLetterListResult(memberInfo,coverLetterQueryService.getOtherCoverLetters(other, page), other
));
}

@Operation(summary = "만족도 저장", description = "쿼리 스트링으로 피드백 ID 또는 분석 ID를, request body로 만족도를 전송합니다.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.codez4.meetfolio.domain.coverLetter.dto;

import com.codez4.meetfolio.domain.coverLetter.CoverLetter;
import com.codez4.meetfolio.domain.member.Member;
import com.codez4.meetfolio.domain.member.dto.MemberResponse.MemberInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down Expand Up @@ -72,6 +73,24 @@ public static CoverLetterInfo toCoverLetterInfo(CoverLetter coverLetter, Boolean
@Getter
public static class CoverLetterListResult {
private MemberInfo memberInfo;
@Schema(description = "작성자 아이디")
private String memberName;
@Schema(description = "작성자 프로필")
private String profile;
private CoverLetterList coverLetterInfo;
}

@Schema(description = "타 사용자 자기소개서 목록 정보 조회 응답 DTO")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
public static class OtherMemberCoverLetterListResult {
private MemberInfo memberInfo;
@Schema(description = "작성자 아이디")
private String memberName;
@Schema(description = "작성자 프로필")
private String profile;
private CoverLetterList coverLetterInfo;
}

Expand Down Expand Up @@ -122,6 +141,16 @@ public static CoverLetterListResult toCoverLetterListResult(MemberInfo memberInf
.build();
}

public static OtherMemberCoverLetterListResult toOtherMemberCoverLetterListResult(MemberInfo memberInfo, Page<CoverLetterItem> coverLetters, Member other){
CoverLetterList coverLetterList = toCoverLetterList(coverLetters);
return OtherMemberCoverLetterListResult.builder()
.memberInfo(memberInfo)
.coverLetterInfo(coverLetterList)
.memberName(other.getEmail().split("@")[0])
.profile(other.getProfile().name())
.build();
}

public static CoverLetterList toCoverLetterList(Page<CoverLetterItem> coverLetters) {
List<CoverLetterItem> coverLetterItems = coverLetters.stream().toList();
return CoverLetterList.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public ApiResponse<ExperienceCardResult> getExperienceCards(@AuthenticationMembe
@Parameter(name = "page", description = "페이징 번호, page, Query String입니다.", example = "0", in = ParameterIn.QUERY)
@Parameter(name = "memberName", description = "다른 사용자 이름, page, Query String입니다.", in = ParameterIn.QUERY)
@PostMapping("/members")
public ApiResponse<ExperienceCardResult> getOtherCoverLetters(
public ApiResponse<OtherMemberExperienceCardResult> getOtherCoverLetters(
@AuthenticationMember Member member,
@RequestParam String memberName,
@RequestParam(value = "page", defaultValue = "0") int page) {
Member other = memberQueryService.findByMemberName(memberName);
ExperienceCardInfo experienceCardInfo = experienceQueryService.getExperienceCardInfo(other,
page);
return ApiResponse.onSuccess(toExperienceCardResult(MemberResponse.toMemberInfo(other), experienceCardInfo));
return ApiResponse.onSuccess(toOtherMemberExperienceCardResult(MemberResponse.toMemberInfo(other), experienceCardInfo, other));
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.codez4.meetfolio.domain.experience.dto;

import com.codez4.meetfolio.domain.experience.Experience;
import com.codez4.meetfolio.domain.member.Member;
import com.codez4.meetfolio.domain.member.dto.MemberResponse.MemberInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -120,6 +121,21 @@ public static class ExperienceCardResult {
private ExperienceCardInfo experienceCardInfo;
}

@Schema(description = "타 사용자 경험 카드 목록 응답 DTO")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
public static class OtherMemberExperienceCardResult {

private MemberInfo memberInfo;
@Schema(description = "작성자 아이디")
private String memberName;
@Schema(description = "작성자 프로필")
private String profile;
private ExperienceCardInfo experienceCardInfo;
}

public static ExperienceCardResult toExperienceCardResult(MemberInfo memberInfo,
ExperienceCardInfo experienceCardInfo) {

Expand All @@ -129,6 +145,16 @@ public static ExperienceCardResult toExperienceCardResult(MemberInfo memberInfo,
.build();
}

public static OtherMemberExperienceCardResult toOtherMemberExperienceCardResult(MemberInfo memberInfo,
ExperienceCardInfo experienceCardInfo, Member other){
return OtherMemberExperienceCardResult.builder()
.memberInfo(memberInfo)
.experienceCardInfo(experienceCardInfo)
.memberName(other.getEmail().split("@")[0])
.profile(other.getProfile().name())
.build();
}

@Schema(description = "경험 카드 목록 응답 DTO")
@Builder
@AllArgsConstructor
Expand Down

0 comments on commit 3412b4b

Please sign in to comment.