Skip to content

Commit

Permalink
Merge branch 'main' into feat/#74
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihye committed Jun 12, 2024
2 parents 000282a + a257075 commit ac78f30
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 106 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package Journey.Together.domain.bookbark.entity;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Plan;
import Journey.Together.domain.member.entity.Member;
import Journey.Together.domain.place.entity.Place;
import Journey.Together.global.common.BaseTimeEntity;
import jakarta.persistence.*;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package Journey.Together.domain.bookbark.entity;

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

public record PlanBookmarkRes(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package Journey.Together.domain.bookbark.repository;


import Journey.Together.domain.bookbark.entity.PlaceBookmark;
import Journey.Together.domain.bookbark.entity.PlanBookmark;
import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Plan;
import Journey.Together.domain.member.entity.Member;
import Journey.Together.domain.place.entity.Place;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
import Journey.Together.domain.bookbark.entity.PlanBookmarkRes;
import Journey.Together.domain.bookbark.repository.PlaceBookmarkRepository;
import Journey.Together.domain.bookbark.repository.PlanBookmarkRepository;
import java.util.Optional;
import Journey.Together.domain.dairy.entity.Day;
import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.dairy.repository.DayRepository;
import Journey.Together.domain.dairy.repository.PlanRepository;
import Journey.Together.domain.dairy.service.PlanService;
import Journey.Together.domain.plan.entity.Day;
import Journey.Together.domain.plan.entity.Plan;
import Journey.Together.domain.plan.repository.DayRepository;
import Journey.Together.domain.plan.repository.PlanRepository;
import Journey.Together.domain.member.entity.Member;
import Journey.Together.domain.place.dto.response.PlaceBookmarkDto;
import Journey.Together.domain.place.entity.DisabilityPlaceCategory;
import Journey.Together.domain.place.entity.Place;
import Journey.Together.domain.place.repository.DisabilityPlaceCategoryRepository;
import Journey.Together.domain.place.repository.PlaceRepository;
Expand Down Expand Up @@ -115,7 +112,7 @@ public List<PlanBookmarkRes> getPlanBookmarks(Member member) {

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

return list;
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/Journey/Together/domain/dairy/dto/PlanReviewReq.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package Journey.Together.domain.member.controller;

import Journey.Together.domain.dairy.dto.PlanReviewReq;
import Journey.Together.domain.member.dto.InterestDto;
import Journey.Together.domain.member.dto.MemberReq;
import Journey.Together.domain.member.dto.MemberRes;
Expand All @@ -9,14 +8,11 @@
import Journey.Together.global.exception.Success;
import Journey.Together.global.security.PrincipalDetails;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.Null;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/member")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package Journey.Together.domain.dairy.controller;
package Journey.Together.domain.plan.controller;

import Journey.Together.domain.dairy.dto.*;
import Journey.Together.domain.dairy.service.PlanService;
import Journey.Together.domain.member.entity.Member;
import Journey.Together.domain.plan.dto.*;
import Journey.Together.domain.plan.service.PlanService;
import Journey.Together.global.common.ApiResponse;
import Journey.Together.global.exception.Success;
import Journey.Together.global.security.PrincipalDetails;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.Null;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import lombok.Builder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import java.time.LocalDate;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.place.entity.Place;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Plan;
import jakarta.validation.constraints.Null;
import lombok.Builder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import lombok.Builder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Plan;
import lombok.Builder;

import java.time.Period;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.place.dto.response.PlaceDetailRes;
import Journey.Together.domain.place.dto.response.PlaceReviewDto;
import Journey.Together.domain.place.entity.Place;
import lombok.Builder;

import java.util.List;

@Builder
public record PlaceInfo(
Long placeId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import lombok.Builder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.member.entity.Member;
import Journey.Together.domain.plan.entity.Plan;
import lombok.Builder;

import java.time.LocalDate;
import java.util.List;

@Builder
public record PlanDetailRes(
String title,
LocalDate startDate,
LocalDate endDate,
String remainDate,
Boolean isPublic,
List<String> imageUrls,
List<DailyList> dailyList,
Boolean isWriter,
Long writerId,
String writerNickname
) {
public static PlanDetailRes of(List<String> imageUrls,
List<DailyList> dailyList, Boolean isWriter, Plan plan){
List<DailyList> dailyList, Boolean isWriter, Plan plan,String remainDate){
return PlanDetailRes.builder()
.title(plan.getTitle())
.startDate(plan.getStartDate())
.endDate(plan.getEndDate())
.remainDate(remainDate)
.isPublic(plan.getIsPublic())
.imageUrls(imageUrls)
.dailyList(dailyList)
.isWriter(isWriter)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import java.time.LocalDate;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Plan;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.Null;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package Journey.Together.domain.plan.dto;

public record PlanReviewReq(
float grade,
String content,
Boolean isPublic
) {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package Journey.Together.domain.dairy.dto;
package Journey.Together.domain.plan.dto;

import Journey.Together.domain.dairy.entity.PlanReview;
import jakarta.validation.constraints.Null;
import lombok.Builder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.entity;
package Journey.Together.domain.plan.entity;

import Journey.Together.domain.member.entity.Member;
import Journey.Together.domain.place.entity.Place;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.entity;
package Journey.Together.domain.plan.entity;

import Journey.Together.domain.member.entity.Member;
import Journey.Together.global.common.BaseTimeEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package Journey.Together.domain.dairy.entity;
package Journey.Together.domain.plan.entity;

import Journey.Together.global.common.BaseTimeEntity;
import jakarta.persistence.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package Journey.Together.domain.dairy.entity;
package Journey.Together.domain.plan.entity;

import Journey.Together.global.common.BaseTimeEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;
import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Journey.Together.domain.dairy.repository;
package Journey.Together.domain.plan.repository;

import Journey.Together.domain.dairy.entity.Day;
import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Day;
import Journey.Together.domain.plan.entity.Plan;
import Journey.Together.domain.member.entity.Member;
import org.springframework.data.jpa.repository.JpaRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package Journey.Together.domain.dairy.repository;
package Journey.Together.domain.plan.repository;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.plan.entity.Plan;
import Journey.Together.domain.member.entity.Member;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.Optional;

import java.time.LocalDate;
import java.util.List;

public interface PlanRepository extends JpaRepository<Plan, Long> {
Plan findPlanByPlanIdAndDeletedAtIsNull(Long planId);

Plan findPlanByMemberAndPlanIdAndDeletedAtIsNull(Member member,Long planId);
List<Plan> findAllByMemberAndDeletedAtIsNull(Member member);
Plan findPlanByMemberAndPlanIdAndEndDateIsBeforeAndDeletedAtIsNull(Member member, Long planId, LocalDate today);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Journey.Together.domain.dairy.repository;
package Journey.Together.domain.plan.repository;

import Journey.Together.domain.dairy.entity.PlanReview;
import Journey.Together.domain.dairy.entity.PlanReviewImage;
import Journey.Together.domain.plan.entity.PlanReview;
import Journey.Together.domain.plan.entity.PlanReviewImage;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Journey.Together.domain.dairy.repository;
package Journey.Together.domain.plan.repository;

import Journey.Together.domain.dairy.entity.Plan;
import Journey.Together.domain.dairy.entity.PlanReview;
import Journey.Together.domain.plan.entity.Plan;
import Journey.Together.domain.plan.entity.PlanReview;
import org.springframework.data.jpa.repository.JpaRepository;


Expand Down
Loading

0 comments on commit ac78f30

Please sign in to comment.