Skip to content

Commit

Permalink
Merge pull request #136 from PawWithU/feat/135-intermediary-get-waiti…
Browse files Browse the repository at this point in the history
…ngs-time-add

[Feature] 이동봉사 중개 승인 대기중 목록 조회 신청 시각 추가 반환
  • Loading branch information
kyeong-hyeok authored Nov 21, 2023
2 parents 018e8c7 + a13d231 commit 11f8b08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;

public record ApplicationIntermediaryWaitingResponse(Long postId, String mainImage, String dogName,
public record ApplicationIntermediaryWaitingResponse(@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "Asia/Seoul")
LocalDateTime applicationTime,
Long postId, String mainImage, String dogName,
@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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Optional<Application> findByIdAndIntermediaryIdAndStatusWithPost(Long app
public List<ApplicationIntermediaryWaitingResponse> getIntermediaryWaitingApplications(Long intermediaryId, Pageable pageable) {
return queryFactory
.select(Projections.constructor(ApplicationIntermediaryWaitingResponse.class,
post.id, postImage.image, dog.name, post.startDate, post.endDate,
application.createdDate, post.id, postImage.image, dog.name, post.startDate, post.endDate,
post.departureLoc, post.arrivalLoc, volunteer.name, application.id))
.from(application)
.join(application.post, post)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.web.filter.CharacterEncodingFilter;

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

Expand Down Expand Up @@ -180,11 +181,12 @@ void setUp() {
//given
Pageable pageable = PageRequest.of(0, 2);
List<ApplicationIntermediaryWaitingResponse> response = new ArrayList<>();
LocalDateTime applicationTime = LocalDateTime.of(2023, 11, 25, 12, 30);
LocalDate startDate = LocalDate.of(2023, 10, 2);
LocalDate endDate = LocalDate.of(2023, 11, 7);
response.add(new ApplicationIntermediaryWaitingResponse(1L, "image1", "포포1", startDate, endDate,
response.add(new ApplicationIntermediaryWaitingResponse(applicationTime, 1L, "image1", "포포1", startDate, endDate,
"서울시 성북구", "서울시 중랑구", "하노정", 1L));
response.add(new ApplicationIntermediaryWaitingResponse(2L, "image2", "포포2", startDate, endDate,
response.add(new ApplicationIntermediaryWaitingResponse(applicationTime, 2L, "image2", "포포2", startDate, endDate,
"서울시 성북구", "서울시 중랑구", "민경혁", 2L));


Expand Down

0 comments on commit 11f8b08

Please sign in to comment.