Skip to content

Commit

Permalink
Merge pull request #68 from Journey-Together/feat/#67
Browse files Browse the repository at this point in the history
[Feat/#67] nickname 및 이미지 url 수정
  • Loading branch information
mmihye authored Jun 10, 2024
2 parents bf2ea8c + fcfe425 commit bfb04bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Journey.Together.domain.bookbark.dto.PlaceBookmarkRes;
import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.global.util.S3Client;
import jakarta.annotation.Nullable;

public record PlanBookmarkRes(
Expand All @@ -12,7 +13,8 @@ public record PlanBookmarkRes(
@Nullable
String image
) {
public static PlanBookmarkRes of(Plan plan, String image){
return new PlanBookmarkRes(plan.getPlanId(), plan.getMember().getName(), plan.getMember().getProfileUuid(), plan.getTitle(), image);

public static PlanBookmarkRes of(Plan plan, String profileImg, String image){
return new PlanBookmarkRes(plan.getPlanId(), plan.getMember().getNickname(), profileImg, plan.getTitle(), image);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import Journey.Together.domain.place.repository.PlaceRepository;
import Journey.Together.global.exception.ApplicationException;
import Journey.Together.global.exception.ErrorCode;
import Journey.Together.global.util.S3Client;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -40,6 +41,9 @@ public class BookmarkService {
private final PlanRepository planRepository;


private final S3Client s3Client;


//북마크한 여행지 이름만 가져오기
public List<PlaceBookmarkDto> getBookmarkPlaceNames(Member member){
List<PlaceBookmark> placeBookmarkList = placeBookmarkRepository.findAllByMemberOrderByPlaceNameAsc(member);
Expand Down Expand Up @@ -111,7 +115,7 @@ public List<PlanBookmarkRes> getPlanBookmarks(Member member) {

List<PlanBookmark> planBookmarkList = planBookmarkRepository.findAllByMemberOrderByCreatedAtDesc(member);
planBookmarkList.forEach( planBookmark -> {
list.add(PlanBookmarkRes.of(planBookmark.getPlan(),getPlanImageUrl(member, planBookmark.getPlan())));
list.add(PlanBookmarkRes.of(planBookmark.getPlan(),s3Client.getUrl()+planBookmark.getMember().getProfileUuid()+"/profile",getPlanImageUrl(member, planBookmark.getPlan())));
});

return list;
Expand Down

0 comments on commit bfb04bf

Please sign in to comment.