12
12
import com .sponus .sponusbe .domain .propose .entity .Propose ;
13
13
import com .sponus .sponusbe .domain .propose .exception .ProposeErrorCode ;
14
14
import com .sponus .sponusbe .domain .propose .exception .ProposeException ;
15
+ import com .sponus .sponusbe .domain .propose .repository .ProposeCustomRepository ;
15
16
import com .sponus .sponusbe .domain .propose .repository .ProposeRepository ;
16
17
17
18
import lombok .RequiredArgsConstructor ;
@@ -23,20 +24,22 @@ public class ProposeQueryService {
23
24
24
25
private final ProposeRepository proposeRepository ;
25
26
27
+ private final ProposeCustomRepository proposeCustomRepository ;
28
+
26
29
public List <ProposeSummaryGetResponse > getProposes (Organization organization , ProposeGetCondition condition ) {
27
30
// TODO : 추후에 QueryDSL 이용
28
31
List <ProposeSummaryGetResponse > response ;
29
32
if (condition .isSentPropose ()) {
30
33
// 내가 보낸 제안은 그냥 반환
31
- response = proposeRepository .findSentPropose (organization .getId ()).stream ()
34
+ response = proposeCustomRepository .findSentPropose (organization .getId ()).stream ()
32
35
.map (ProposeSummaryGetResponse ::from )
33
36
.toList ();
34
37
} else {
35
38
// 내가 받은 제안은 공고 id 별로 보여줘야하고, 공고 id가 없으면 안됨
36
39
if (condition .announcementId () == null ) {
37
40
throw new ProposeException (ProposeErrorCode .ANNOUNCEMENT_ID_IS_REQUIRED );
38
41
}
39
- response = proposeRepository .findReceivedProposeWithAnnouncementId (
42
+ response = proposeCustomRepository .findReceivedProposeWithAnnouncementId (
40
43
organization .getId (),
41
44
condition .announcementId ())
42
45
.stream ()
0 commit comments