Skip to content

Commit

Permalink
Merge pull request #297 from Open-Eye-Im-Developer/develop
Browse files Browse the repository at this point in the history
[REFACT] 현재 매칭 된 프로젝트 정보 가져오기 기능 스키마 수정 (#296)
[FEAT] 매칭 요청시 PULL 알림 전달 기능 추가 (#293)
  • Loading branch information
happyjamy authored Mar 20, 2024
2 parents f514fbb + 04d3798 commit 52701ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,30 @@
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Schema(description = "사용자가 매칭 된 프로젝트 DTO")
@Getter
@NoArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class MatchingProjectRes {

private Long matchingId;
private ProjectDetailAPIRes response;
private Long projectRequesterId;

public MatchingProjectRes(
Long matchingId, Long id, User creator, ProjectStatus status, List<ProjectTag> tags,
LocalDateTime projectStartTime, LocalDateTime projectEndTime, String locationDetail
LocalDateTime projectStartTime, LocalDateTime projectEndTime, String locationDetail,
Long projectRequesterId
) {
var tagString = tags.stream().map(ProjectTag::getContent).toList();
this.matchingId = matchingId;
this.response = ProjectDetailAPIRes.of(
id, creator, status, tagString,
new MeetingInfoResponse(projectStartTime, projectEndTime, locationDetail));
}

public MatchingProjectRes(Long matchingId, ProjectDetailAPIRes response) {
this.matchingId = matchingId;
this.response = response;
this.projectRequesterId = projectRequesterId;
}

public static MatchingProjectRes from(
Expand All @@ -50,11 +49,12 @@ public static MatchingProjectRes from(
matching.getProject().getProjectTags(),
matching.getProject().getMeetingInfo().getMeetStartTime(),
matching.getProject().getMeetingInfo().getMeetEndTime(),
matching.getProject().getMeetingInfo().getMeetDetail()
matching.getProject().getMeetingInfo().getMeetDetail(),
matching.getSender().getId()
);
}

public static MatchingProjectRes createNoMatchingRes() {
return new MatchingProjectRes(null, null);
return new MatchingProjectRes();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import io.oeid.mogakgo.domain.user.domain.User;
import io.oeid.mogakgo.domain.user.exception.UserException;
import io.oeid.mogakgo.domain.user.infrastructure.UserJpaRepository;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -59,7 +58,8 @@ public Long create(Long userId, ProjectJoinCreateReq request) {
// 프로젝트 매칭 요청 생성
ProjectJoinRequest joinRequest = request.toEntity(tokenUser, project);
projectJoinRequestRepository.save(joinRequest);

// 매칭 요청 생성시 프로젝트 생성자에게 알림 전달
notificationService.createRequestArrivalNotification(project.getCreator().getId());
return joinRequest.getId();
}

Expand Down

0 comments on commit 52701ce

Please sign in to comment.