Skip to content

Commit

Permalink
Merge pull request #44 from StudyFlexUMC5th/yeeun2
Browse files Browse the repository at this point in the history
Yeeun2
  • Loading branch information
Yeeun411 authored Jan 13, 2024
2 parents 2cb1984 + 6619ff2 commit 7a013bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/main/java/com/umc/StudyFlexBE/service/MemberService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import com.umc.StudyFlexBE.dto.response.BaseResponseStatus;
import com.umc.StudyFlexBE.dto.response.LoginRes;
import com.umc.StudyFlexBE.dto.response.GetParticipationStudyRes;
import com.umc.StudyFlexBE.entity.KaKaoOAuthToken;
import com.umc.StudyFlexBE.entity.Member;
import com.umc.StudyFlexBE.entity.OAuthProfile;
import com.umc.StudyFlexBE.entity.StudyParticipation;
import com.umc.StudyFlexBE.entity.*;
import com.umc.StudyFlexBE.repository.MemberRepository;
import com.umc.StudyFlexBE.repository.StudyParticipationRepository;
import jakarta.mail.internet.MimeMessage;
Expand Down Expand Up @@ -87,6 +84,7 @@ public void signUpOAUth(SignUpOAuthDto signUpOAuthDto) {
member.setEmail(signUpOAuthDto.getEmail());
member.setName(signUpOAuthDto.getName());
member.setPassword(passwordEncoder.encode("12345"));
member.setMember_type(MemberType.kakao);
member.setSchool(signUpOAuthDto.getSchool());
memberRepository.save(member);
} else{
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/umc/StudyFlexBE/service/NaverService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.umc.StudyFlexBE.dto.response.APICallException;
import com.umc.StudyFlexBE.dto.response.InvalidAuthorizationCodeException;
import com.umc.StudyFlexBE.entity.Member;
import com.umc.StudyFlexBE.entity.MemberType;
import com.umc.StudyFlexBE.entity.Role;
import com.umc.StudyFlexBE.repository.MemberRepository;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -137,6 +138,7 @@ public Member registerOrAuthenticate(NaverDto naverUser) {
newMember.setName(naverUser.getName());
newMember.setPassword(passwordEncoder.encode("defaultPassword"));
newMember.setRole(Role.ROLE_USER);
newMember.setMember_type(MemberType.naver);
newMember.setNewUser(true); // 새로운 사용자 표시하기

memberRepository.save(newMember);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public List<StudyMainPageResponseDto> getLatestStudies() {
}

public List<StudyMainPageResponseDto> getOpenStudies() {
List<Study> openedStudies = studyRepository.findByStatus(StudyStatus.valueOf("RECRUITING"));
List<Study> openedStudies = studyRepository.findByStatus(StudyStatus.RECRUITING);

return openedStudies.stream()
.map(study -> StudyMainPageResponseDto.builder()
Expand Down

0 comments on commit 7a013bc

Please sign in to comment.