Skip to content

Commit

Permalink
feat: 이동봉사 모집자 봉사 완료 목록 조회 API 반환값 수정 (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeong-hyeok committed Apr 28, 2024
1 parent 2d4baef commit 929f5e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package com.pawwithu.connectdog.domain.application.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pawwithu.connectdog.domain.dog.entity.DogSize;

import java.time.LocalDate;

public record ApplicationIntermediaryCompletedResponse(Long postId, String mainImage, String dogName,
String departureLoc, String arrivalLoc,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
LocalDate startDate,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
LocalDate endDate,
String departureLoc, String arrivalLoc,
String volunteerName, Long applicationId,
Long reviewId, Long dogStatusId) {
String pickUpTime,
String dogSize,
Boolean isKennel,
Long reviewId) {
public ApplicationIntermediaryCompletedResponse(Long postId, String mainImage, String dogName,
String departureLoc, String arrivalLoc, LocalDate startDate, LocalDate endDate,
String pickUpTime, DogSize dogSize, Boolean isKennel, Long reviewId) {
this(postId, mainImage, dogName, departureLoc, arrivalLoc, startDate, endDate, pickUpTime,
dogSize.getKey(), isKennel, reviewId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ public List<ApplicationVolunteerCompletedResponse> getVolunteerCompletedApplicat
public List<ApplicationIntermediaryCompletedResponse> getIntermediaryCompletedApplications(Long intermediaryId, Pageable pageable) {
return queryFactory
.select(Projections.constructor(ApplicationIntermediaryCompletedResponse.class,
post.id, postImage.image, dog.name, post.startDate, post.endDate, post.departureLoc, post.arrivalLoc,
volunteer.name, application.id, review.id, dogStatus.id))
post.id, postImage.image, dog.name, post.departureLoc, post.arrivalLoc,
post.startDate, post.endDate, post.pickUpTime,
dog.size, post.isKennel, review.id))
.from(application)
.join(application.post, post)
.join(application.post.mainImage, postImage)
.join(application.post.dog, dog)
.join(application.volunteer, volunteer)
.leftJoin(review).on(post.id.eq(review.post.id))
.leftJoin(dogStatus).on(post.id.eq(dogStatus.post.id))
.where(application.status.eq(ApplicationStatus.COMPLETED)
Expand Down

0 comments on commit 929f5e5

Please sign in to comment.