Skip to content

Commit

Permalink
Merge pull request #166 from pknu-wap/feature/또또추가사항
Browse files Browse the repository at this point in the history
깃허브 수정
  • Loading branch information
JONG-KYEONG authored Nov 29, 2023
2 parents 86187b5 + 014982b commit 0f98081
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ResponseEntity<PrUnPostResponse> getPullrequest(@CurrentUser UserPrincipa
User user = userRepository.findById(userPrincipal.getId()).get();
String repo = gitHubService.getRepoName(categoryId);

GithubRepository githubRepository = githubRepoRepository.findRepoByUserId(user.getId(), repo).get();
GithubRepository githubRepository = githubRepoRepository.findRepoByUserId(user.getId(), repo, categoryId).get();
List<PrInfo> prInfos = gitHubService.getPr(user,githubRepository.getOwnerName(),repo);

return new ResponseEntity<>(gitHubService.saveAndGetPr(prInfos, githubRepository, categoryId, user),HttpStatus.OK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public interface GithubRepoRepository extends JpaRepository<GithubRepository, Lo
@Query("SELECT gr FROM GithubRepository gr WHERE gr.user.id = :userId AND gr.repoName= :reponame AND gr.isCategoryRegi=false")
Optional <GithubRepository> findByRepoName(@Param("userId") Long userid , @Param("reponame") String reponame);

@Query("SELECT gr FROM GithubRepository gr WHERE gr.user.id = :userId AND gr.repoName=:repo")
Optional <GithubRepository> findRepoByUserId(@Param("userId") Long userid, @Param("repo") String repo);
@Query("SELECT gr FROM GithubRepository gr WHERE gr.user.id = :userId AND gr.repoName=:repo AND gr.category.id=:categoryId")
Optional <GithubRepository> findRepoByUserId(@Param("userId") Long userid, @Param("repo") String repo,@Param("categoryId") Long categoryId);

@Query("SELECT gr.repoName FROM GithubRepository gr WHERE gr.user.id = :userId AND gr.isCategoryRegi=false")
List<String> findRepoNameByUserId(@Param("userId") Long userid);
Expand Down

0 comments on commit 0f98081

Please sign in to comment.