Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/42/review' into feat/42/review
Browse files Browse the repository at this point in the history
  • Loading branch information
nohy6630 committed May 18, 2024
2 parents de9c6d4 + 2514bfa commit 7059b5b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public class KakaoController {
등록되지 않은 사용자면 "/sign-up"을 요청해서 거주지 정보를 추가로 받아줘야 합니다.
""")
@GetMapping("/login/kakao")
public ResponseEntity<Object> kakaoLogin(@RequestParam String code) throws JsonProcessingException {
public ResponseEntity<CreateOauthUserRequest> kakaoLogin(@RequestParam String code) throws JsonProcessingException {
String kakaoAccessToken = kakaoService.getKakaoAccessToken(code); //인가코드로 카카오 엑세스 토큰 받아오기
CreateOauthUserRequest request = kakaoService.getKakaoInfo(kakaoAccessToken); //엑세스 토큰으로 카카오 사용자 정보 받아오기
boolean checkExist = loginService.userExists(request.getEmail());
if(checkExist) { //이미 가입된 회원
User user = userRepository.findByEmail(request.getEmail());
HttpHeaders headers = kakaoService.getLoginHeader(user);

return ResponseEntity.ok().headers(headers).body("login");
return ResponseEntity.ok().headers(headers).body(request);
//로그인 처리하기
} else { //신규 회원
return ResponseEntity.ok().body(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.meetup.teame.backend.domain.user.dto.request.ReadCalenderReq;
import com.meetup.teame.backend.domain.user.dto.request.UpdateUserReq;
import com.meetup.teame.backend.domain.user.dto.response.ReadCalenderRes;
import com.meetup.teame.backend.domain.user.dto.response.ReadExperienceProfileRes;
import com.meetup.teame.backend.domain.user.dto.response.ReadMainRes;
import com.meetup.teame.backend.domain.user.dto.response.UserInfoRes;
import com.meetup.teame.backend.domain.user.service.UserService;
Expand Down Expand Up @@ -63,11 +64,11 @@ public ResponseEntity<Void> setUserPersonality(@RequestBody @Valid OnboardingReq
임시로 고정된 더미 유저의 캘린더 정보를 조회하는 식으로 구현되어 있습니다.
jwt토큰도 같이 전달해서 요청해주셔야 합니다.
url 쿼리 파라미터로 다음과 같은 값을 전달해 주셔야 합니다.
year : 년도
month : 월
""")
@GetMapping("/mypage/calender")
Expand All @@ -77,9 +78,9 @@ public ResponseEntity<ReadCalenderRes> readCalender(@ModelAttribute @Valid ReadC
}

@Operation(summary = "사용자 기본 정보 조회", description = """
사용자의 기본 정보를 볼 수 있는 api입니다.
추후 로그인 적용 시에는 jwt토큰도 같이 전달해서 요청해주셔야 합니다.
""")
//기본 정보 조회
Expand All @@ -91,7 +92,7 @@ public ResponseEntity<UserInfoRes> getUserInfo() {

@Operation(summary = "사용자 기본 정보 수정", description = """
사용자의 기본 정보를 수정하는 api입니다.
name, email, imageUrl, location 데이터를 받습니다.
""")
//기본 정보 수정
Expand All @@ -117,12 +118,18 @@ public ResponseEntity<List<MyReviewRes>> getMyReviews(@RequestParam(required = f

@Operation(summary = "내 활동 참여 목록 조회", description = """
내 활동 참여 목록을 조회하는 api입니다.
api 요청 시 보낼 데이터는 token 이외에 없습니다.
""")
@GetMapping("/activities")
public ResponseEntity<List<ActivitySummaryRes>> getMyActivities() {
List<ActivitySummaryRes> myActivities = userService.getMyActivities();
return ResponseEntity.ok().body(myActivities);
}

/* @PostMapping("/experience-profile")
public ResponseEntity<ReadExperienceProfileRes> createExperienceProfile() {
ReadExperienceProfileRes profile = userService.createExperienceProfile();
return ResponseEntity.ok().body(profile);
}*/
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.meetup.teame.backend.domain.user.dto.response;

import com.meetup.teame.backend.domain.chatroom.entity.Appointment;
import com.meetup.teame.backend.domain.chatroom.entity.DirectChatRoom;
import com.meetup.teame.backend.domain.chatroom.entity.GroupChatRoom;
import lombok.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.meetup.teame.backend.domain.user.dto.response;

import lombok.*;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@Getter
public class ReadExperienceProfileRes {

private Long id;

private String name;

private Long age;

private String gender;

private String location;

private String area;

private String introduce;


}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.meetup.teame.backend.domain.user.dto.request.ReadCalenderReq;
import com.meetup.teame.backend.domain.user.dto.request.UpdateUserReq;
import com.meetup.teame.backend.domain.user.dto.response.ReadCalenderRes;
import com.meetup.teame.backend.domain.user.dto.response.ReadExperienceProfileRes;
import com.meetup.teame.backend.domain.user.dto.response.ReadMainRes;
import com.meetup.teame.backend.domain.user.dto.response.UserInfoRes;
import com.meetup.teame.backend.domain.user.entity.Gender;
Expand Down Expand Up @@ -148,4 +149,11 @@ public ReadCalenderRes readCalender(ReadCalenderReq readCalenderReq) {
groupChatRoomRepository.findAppointmentForUserInMonth(user, readCalenderReq.getYear(), readCalenderReq.getMonth())
);
}

/*public ReadExperienceProfileRes createExperienceProfile() {
Long userId = SecurityContextProvider.getAuthenticatedUserId();
User user = userRepository.findById(userId)
.orElseThrow(() -> new CustomException(ExceptionContent.NOT_FOUND_USER));
}*/
}

0 comments on commit 7059b5b

Please sign in to comment.