Skip to content

Commit

Permalink
Merge pull request #120 from Gongjakso/feat/apply
Browse files Browse the repository at this point in the history
Feat/apply
  • Loading branch information
sycuuui authored Apr 29, 2024
2 parents 7df7b60 + 676af72 commit 2ba4dc3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public record ApplicationRes(
ApplyType applyType,
String member_name,
String major,
String phone,
String application,
String recruit_part,
List<String> category,
Expand All @@ -24,6 +25,6 @@ public record ApplicationRes(

) {
public static ApplicationRes of(Apply apply, List<String> category,List<String> stackName,List<String> applyStack){
return new ApplicationRes(apply.getApplyType(),apply.getMember().getName(), apply.getMember().getMajor(),apply.getApplication(), apply.getRecruit_part(), category, stackName,applyStack);
return new ApplicationRes(apply.getApplyType(),apply.getMember().getName(), apply.getMember().getMajor(),apply.getMember().getPhone(),apply.getApplication(), apply.getRecruit_part(), category, stackName,applyStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

public interface ApplyRepository extends JpaRepository<Apply,Long> {
long countApplyWithStackNameUsingFetchJoinByPost(Post post);
long countApplyWithStackNameUsingFetchJoinByPostAndApplyType(Post post,ApplyType applyType);
boolean existsApplyByMemberAndPost(Member member,Post post);
Page<Apply> findAllByPost(Post post, Pageable pageable);
Page<Apply> findApplyByApplyType(ApplyType applyType, Pageable pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public ApplyRes findApply(Member member,Long post_id) {
//Change List Type
List<String> categoryList = changeCategoryType(post);

int current_person = (int) applyRepository.countApplyWithStackNameUsingFetchJoinByPost(post);
int current_person = (int) applyRepository.countApplyWithStackNameUsingFetchJoinByPostAndApplyType(post,ApplyType.PASS);
return ApplyRes.of(post, current_person, categoryList);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gongjakso.server.domain.post.service;

import com.gongjakso.server.domain.apply.enumerate.ApplyType;
import com.gongjakso.server.domain.apply.repository.ApplyRepository;
import com.gongjakso.server.domain.member.entity.Member;
import com.gongjakso.server.domain.post.dto.*;
Expand Down Expand Up @@ -77,7 +78,7 @@ public Optional<?> read(PrincipalDetails principalDetails, Long id, String role)
if (post == null) {
throw new ApplicationException(NOT_FOUND_POST_EXCEPTION);
}
int current_person = (int) applyRepository.countApplyWithStackNameUsingFetchJoinByPost(post);
int current_person = (int) applyRepository.countApplyWithStackNameUsingFetchJoinByPostAndApplyType(post, ApplyType.PASS);

post.updatePostView(post.getPostView());

Expand Down

0 comments on commit 2ba4dc3

Please sign in to comment.