Skip to content

Commit

Permalink
Merge branch 'develop' into feature/#224
Browse files Browse the repository at this point in the history
  • Loading branch information
kimday0326 authored Feb 18, 2024
2 parents 615a518 + f471f76 commit 83f0478
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| :memo:`comment` | 필요한 주석 추가 및 변경 |
| :memo:`docs` | 문서, Swagger 를 수정한 경우 |
| :hammer:`test` | 테스트 추가, 테스트 리팩토링(프로덕션 코드 변경 X) |
| `chore` | 빌드 태스트 업데이트, 패키지 매니저를 설정하는 경우(프로덕션 코드 변경 X) |
| `chore` | 빌드 테스트 업데이트, 패키지 매니저를 설정하는 경우(프로덕션 코드 변경 X) |
| `rename` | 파일 혹은 폴더명을 수정하거나 옮기는 작업만인 경우 |
| `remove` | 파일을 삭제하는 작업만 수행한 경우 |
| :construction_worker: `ci` | 배포 방식 수정 및 새로 추가 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ApiResponse<List<DateGroupedProposeResponse>> getSentProposes(
@GetMapping("/received")
public ApiResponse<List<DateGroupedProposeResponse>> getReceivedProposes(
@AuthOrganization Organization authOrganization,
@RequestParam Long announcementId
@RequestParam(required = false) Long announcementId
) {
return ApiResponse.onSuccess(proposeQueryService.getReceivedProposes(authOrganization, announcementId));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ public interface ProposeCustomRepository {
List<Propose> findSentPropose(Long id);

List<Propose> findReceivedProposeWithAnnouncementId(Long organizationId, Long announcementId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.springframework.stereotype.Repository;

import com.querydsl.core.BooleanBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.sponus.sponusbe.domain.propose.entity.Propose;
import com.sponus.sponusbe.domain.propose.entity.QPropose;
Expand Down Expand Up @@ -36,9 +37,16 @@ public List<Propose> findReceivedProposeWithAnnouncementId(Long organizationId,

JPAQueryFactory queryFactory = new JPAQueryFactory(entityManager);

BooleanBuilder whereClause = new BooleanBuilder();
whereClause.and(p.proposedOrganization.id.eq(organizationId));

if (announcementId != null) {
whereClause.and(p.announcement.id.eq(announcementId));
}

return queryFactory.selectFrom(p)
.where(p.proposedOrganization.id.eq(organizationId)
.and(p.announcement.id.eq(announcementId)))
.where(whereClause)
.orderBy(p.createdAt.desc())
.leftJoin(p.proposedOrganization).fetchJoin()
.leftJoin(p.announcement)
.fetch();
Expand Down

0 comments on commit 83f0478

Please sign in to comment.