Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public AcceptedCollaborationDto toAcceptedDto(CollectionGathering cg,

// 작성자 정보
User writer = hub.getWriter();
String writerName = writer.getName();
String writerName = writer.getNickName();

return AcceptedCollaborationDto.builder()
.collectionGatheringId(cg.getId())
Expand All @@ -56,7 +56,7 @@ public AcceptedCollaborationDto toAcceptedDto(CollectionGathering cg,
.postTitle(hub.getTitle())
.specialization(hub.getSpecialization())
.domain(recruitment.getDomain())
.writerName(writerName)
.writerNickName(writerName)
.writerType(writer.getUserType())
.teamInfoList(teamInfoList)
.collaborationId(hub.getId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public IdeaMarketPurchaseDto toPurchaseDto(IdeaMarketPurchasing purchasing) {

// 작성자
User writer = ideaMarket.getWriter();
String writerName = writer.getName();
String writerName = writer.getNickName();
Long itemPrice = ideaMarket.getPrice().getPrice();

return IdeaMarketPurchaseDto.builder()
.purchasingId(purchasingId)
.purchasedAt(purchasedAt)
.specialization(category)
.title(title)
.writerName(writerName)
.writerNickName(writerName)
.writerType(writer.getUserType())
.middlePrice(itemPrice)
.quantity(purchasing.getQuantity())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public AcceptedRequestTaskPurchasingDto toAcceptedDto(RequestTaskPurchasing p) {
RequestTask requestTask = recruitment.getRequestTask();

User writer = requestTask.getWriter();
String writerName = writer.getName();
String writerName = writer.getNickName();

return AcceptedRequestTaskPurchasingDto.builder()
.purchasingId(p.getId())
Expand All @@ -49,7 +49,7 @@ public AcceptedRequestTaskPurchasingDto toAcceptedDto(RequestTaskPurchasing p) {
.postTitle(requestTask.getTitle())
.specialization(requestTask.getSpecialization())
.domain(recruitment.getDomain())
.writerName(writerName)
.writerNickName(writerName)
.writerType(writer.getUserType())
.requestTaskId(requestTask.getId())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AcceptedCollaborationDto {
private String domain; // 내가 지원한 파트 (ex: "PM")

// 게시글 관리자
private String writerName; // 작성자 이름 (ex: "SEO YEON")
private String writerNickName; // 작성자 이름 (ex: "SEO YEON")
private String writerType; // "개인" or "회사"

// 팀원 정보 (모든 도메인에 대한 현재인원/총인원 + 멤버)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AcceptedRequestTaskPurchasingDto {
private String domain; // 지원 파트

// 게시물 작성자 정보 (이름 + 개인/회사)
private String writerName;
private String writerNickName;
private String writerType; // "개인" or "회사"
private Long requestTaskId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class IdeaMarketPurchaseDto {
// 게시글 정보
private Specialization specialization;
private String title;
private String writerName;
private String writerNickName;
private String writerType; // "개인"/"회사"
private Long middlePrice; //원가 *수량
// 수량
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public record PostCollaborationResponse(
Long ideaId,
PostAuth auth,
String writerImageUrl,
String writerName,
String writerNickName,
String thumbnailImageUrl,
String title,
@Schema(type = "string", example = "yyyy-MM-dd HH:mm")
Expand All @@ -34,7 +34,7 @@ public static PostCollaborationResponse from(CollaborationHub collaborationHub,
collaborationHub.getId(),
collaborationHub.getPostAuth(),
collaborationHub.getWriter().getProfileImage(),
collaborationHub.getWriter().getName(),
collaborationHub.getWriter().getNickName(),
collaborationHub.getFirstImage(),
collaborationHub.getTitle(),
collaborationHub.getDeadline(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public record PostIdeaMarketResponse(
Long ideaId,
PostAuth auth,
String writerImageUrl,
String writerName,
String writerNickName,
String thumbnailImageUrl,
String title,
Long price,
Expand All @@ -21,7 +21,7 @@ public static PostIdeaMarketResponse from(IdeaMarket ideaMarket, Long saveCount)
ideaMarket.getId(),
ideaMarket.getPostAuth(),
ideaMarket.getWriter().getProfileImage(),
ideaMarket.getWriter().getName(),
ideaMarket.getWriter().getNickName(),
ideaMarket.getImageList().isEmpty() ? "thumbnail does not exist" : ideaMarket.getImageList().get(0),
ideaMarket.getTitle(),
ideaMarket.getPrice().getPrice(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public record PostRequestTaskResponse(
Long ideaId,
PostAuth auth,
String writerImageUrl,
String writerName,
String writerNickName,
String thumbnailImageUrl,
String title,
@Schema(type = "string", example = "yyyy-MM-dd HH:mm")
Expand All @@ -31,7 +31,7 @@ public static PostRequestTaskResponse from(RequestTask requestTask, Long saveCou
requestTask.getId(),
requestTask.getPostAuth(),
requestTask.getWriter().getProfileImage(),
requestTask.getWriter().getName(),
requestTask.getWriter().getNickName(),
requestTask.getFirstImage(),
requestTask.getTitle(),
requestTask.getDeadline(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public IndividualProfileResponseDto toDto(User user) {
.profileImage(user.getProfileImage())
.specializations(profile.getSpecializationList().stream()
.toList())
.name(user.getName())
.nickname(user.getNickName())
.selfIntroduction(profile.getSelfIntroduction())
.contacts(profile.getContacts().stream()
.filter(Contact::getIsPublic)
Expand Down Expand Up @@ -61,7 +61,7 @@ public CompanyProfileResponseDto toCompanyDto(Company user) {
.userType(user.getUserType())
.specializations(profile.getSpecializationList().stream()
.toList())
.name(user.getName())
.nickname(user.getNickName())
.imageUrl(user.getProfileImage())
.selfIntroduction(profile.getSelfIntroduction())
.businessInformation(profile.getBusinessInformation())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import com.brainpix.post.entity.idea_market.IdeaMarket;
import com.brainpix.post.entity.request_task.RequestTask;
import com.brainpix.profile.dto.PublicProfileResponseDto;
import com.brainpix.user.entity.Company;
import com.brainpix.user.entity.User;

@Component
public class ProfilePostConverter {
Expand All @@ -17,14 +15,13 @@ public class ProfilePostConverter {
*/
public PublicProfileResponseDto.PostPreviewDto toRequestTaskPreviewDto(RequestTask task, long savedCount) {
String openScope = parseOpenScope(task.getPostAuth());
String writerName = getDisplayName(task.getWriter());

return PublicProfileResponseDto.PostPreviewDto.builder()
.postId(task.getId())
.openScope(openScope)
.specialization(task.getSpecialization())
.title(task.getTitle())
.writerName(writerName)
.writerName(task.getWriter().getNickName())
.savedCount(savedCount)
.viewCount(task.getViewCount())
.deadline(task.getDeadline())
Expand All @@ -38,14 +35,13 @@ public PublicProfileResponseDto.PostPreviewDto toRequestTaskPreviewDto(RequestTa
*/
public PublicProfileResponseDto.PostPreviewDto toIdeaMarketPreviewDto(IdeaMarket market, long savedCount) {
String openScope = parseOpenScope(market.getPostAuth());
String writerName = getDisplayName(market.getWriter());

return PublicProfileResponseDto.PostPreviewDto.builder()
.postId(market.getId())
.openScope(openScope)
.specialization(market.getSpecialization())
.title(market.getTitle())
.writerName(writerName)
.writerName(market.getWriter().getNickName())
.savedCount(savedCount)
.viewCount(market.getViewCount())
.thumbnailImage(market.getFirstImage())
Expand All @@ -61,14 +57,13 @@ public PublicProfileResponseDto.PostPreviewDto toCollaborationHubPreviewDto(Coll
long currentMembers = hub.getOccupiedQuantity();
long totalMembers = hub.getTotalQuantity();
String openScope = parseOpenScope(hub.getPostAuth());
String writerName = getDisplayName(hub.getWriter());

return PublicProfileResponseDto.PostPreviewDto.builder()
.postId(hub.getId())
.openScope(openScope)
.specialization(hub.getSpecialization())
.title(hub.getTitle())
.writerName(writerName)
.writerName(hub.getWriter().getNickName())
.savedCount(savedCount)
.viewCount(hub.getViewCount())
.deadline(hub.getDeadline())
Expand All @@ -79,14 +74,6 @@ public PublicProfileResponseDto.PostPreviewDto toCollaborationHubPreviewDto(Coll
.build();
}

private String getDisplayName(User user) {
if (user instanceof Company) {
return user.getName(); // 기업명
} else {
return user.getNickName(); // 개인 닉네임
}
}

private String parseOpenScope(PostAuth auth) {
if (auth == PostAuth.COMPANY)
return "기업 공개";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CompanyProfileResponseDto {
private String imageUrl;
private String userType; // 개인/기업
private List<Specialization> specializations;
private String name; // 기업 이름
private String nickname; // 기업 이름
private String selfIntroduction; // 기업 소개
private String businessInformation; // 사업 정보

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class IndividualProfileResponseDto {
private String profileImage;
private String userType; // 개인/기업
private List<Specialization> specializations; // 전문 분야 (e.g., "IT/디자인")
private String name; // 사용자 이름
private String nickname; // 사용자 이름
private String selfIntroduction; // 자기소개

@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@Getter
@Builder
public class MyPageResponseDto {
private String name; // 사용자 이름
private String nickname; // 사용자 이름
private String userType; // 개인/기업
private List<Specialization> specializations; // 분야 (최대 2개)
private long ideaCount; // 아이디어 작성 횟수
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public MyPageResponseDto getMyPage(Long userId) {
String selfIntroduction = getSelfIntroduction(user);

return MyPageResponseDto.builder()
.name(user.getName())
.nickname(user.getNickName())
.userType(user.getUserType())
.specializations(specializations)
.ideaCount(ideaCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IndividualProfileResponseDto getPublicIndividualProfile(Long userId) {
.profileImage(profileDto.getProfileImage())
.userType(profileDto.getUserType())
.specializations(profileDto.getSpecializations())
.name(profileDto.getName())
.nickname(profileDto.getNickname())
.selfIntroduction(profileDto.getSelfIntroduction())
.contacts(profileDto.getContacts().stream()
.filter(IndividualProfileResponseDto.ContactDto::getIsPublic)
Expand Down Expand Up @@ -97,7 +97,7 @@ public CompanyProfileResponseDto getPublicCompanyProfile(Long userId) {
.imageUrl(profileDto.getImageUrl())
.userType(profileDto.getUserType())
.specializations(profileDto.getSpecializations())
.name(profileDto.getName())
.nickname(profileDto.getNickname())
.selfIntroduction(profileDto.getSelfIntroduction())
.businessInformation(profileDto.getBusinessInformation())
.companyInformations(profile.getOpenInformation() ? profileDto.getCompanyInformations() :
Expand Down