From 037e90522ba70d521b4a0d4e11581857249d4e05 Mon Sep 17 00:00:00 2001 From: Ganghee-Lee-0522 Date: Sat, 13 Jan 2024 04:08:02 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20CORS=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서비스 코드를 수정하였습니다. --- .../auth/github/GitHubService.java | 6 +---- .../domain/commit/service/CommitService.java | 27 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/auth/github/GitHubService.java b/src/main/java/com/committers/snowflowerthon/committersserver/auth/github/GitHubService.java index ebd0880..9144d57 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/auth/github/GitHubService.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/auth/github/GitHubService.java @@ -20,7 +20,7 @@ public class GitHubService { @Transactional public int getRepos(String nickname) { - /* + RestTemplate restTemplate = new RestTemplate(); int page = 1; @@ -73,10 +73,6 @@ public int getRepos(String nickname) { // } } return totalCommits; - - */ - - return 100; } private int getCommits(String nickname, List repositories) { diff --git a/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java b/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java index fb84ba8..179b0d0 100644 --- a/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java +++ b/src/main/java/com/committers/snowflowerthon/committersserver/domain/commit/service/CommitService.java @@ -56,32 +56,5 @@ public Long setSnowflake(OAuth2MemberDto memberDto) { log.info("커밋 저장 되었는지 조회: commitRepository.findById -> {}", commitRepository.findById(commit.getId())); return totalCommits; - -// log.info("첫 가입 시 눈송이 설정: setSnowflake"); -// log.info("memberDto -> {}", memberDto.getNickname()); -// -// // 깃허브에서 커밋 개수 가져오기 -// String nickname = memberDto.getNickname(); -// Long totalCommits = Long.valueOf(gitHubService.getRepos(nickname)); -// log.info("setSnowflake로 넘겨진 totalCommits -> {}", totalCommits); -// -// // 멤버 커밋 개수 업데이트 -// Member member = memberRepository.findByNickname(memberDto.getNickname()).orElseThrow(() -> new MemberException(ErrorCode.MEMBER_NOT_FOUND)); -// log.info("멤버 기존 커밋 개수 snowflake -> {}", member.getSnowflake()); -// member.updateSnowflake(totalCommits); -// log.info("멤버 커밋 개수 업데이트 snowflake -> {}", member.getSnowflake()); -// -// // 커밋 객체 생성 -// Commit commit = Commit.builder() -// .count(totalCommits) -// .member(member) -// .build(); -// -// // 커밋 객체 저장 -// commitRepository.save(commit); -// log.info("커밋 객체 -> {}", commit.getCount()); -// log.info("커밋 저장 되었는지 조회: commitRepository.findById -> {}", commitRepository.findById(commit.getId())); -// -// return totalCommits; } }