Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 현재 회원 매칭 상태 확인하는 기능 구현 #177

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.oeid.mogakgo.domain.user.presentation.dto.req.UserSignUpApiReq;
import io.oeid.mogakgo.domain.user.presentation.dto.req.UserUpdateApiReq;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserDevelopLanguageApiRes;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserMatchingStatus;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserPublicApiResponse;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserSignUpApiResponse;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserUpdateApiRes;
Expand Down Expand Up @@ -83,6 +84,9 @@ ResponseEntity<UserSignUpApiResponse> userSignUpApi(
ResponseEntity<List<UserDevelopLanguageApiRes>> userDevelopLanguageApi(
@Parameter(hidden = true) Long userId);

@Operation(summary = "매칭 상태 조회", description = "매칭 상태를 조회할 때 사용하는 API")
@ApiResponse(responseCode = "200", description = "매칭 상태 조회 성공")
ResponseEntity<UserMatchingStatus> userMatchingStatusApi(@Parameter(hidden = true) Long userId);

@Operation(summary = "회원 정보 수정", description = "회원 정보를 수정할 때 사용하는 API")
@ApiResponses(value = {
Expand All @@ -105,4 +109,5 @@ ResponseEntity<List<UserDevelopLanguageApiRes>> userDevelopLanguageApi(
})
ResponseEntity<UserUpdateApiRes> userUpdateApi(@Parameter(hidden = true) Long userId,
UserUpdateApiReq request);

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.oeid.mogakgo.domain.matching.presentation.dto.MatchingId;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import io.oeid.mogakgo.common.annotation.UserId;
import io.oeid.mogakgo.common.swagger.template.UserSwagger;
import io.oeid.mogakgo.domain.matching.application.UserMatchingService;
import io.oeid.mogakgo.domain.user.application.UserService;
import io.oeid.mogakgo.domain.user.application.dto.req.UserUpdateReq;
import io.oeid.mogakgo.domain.user.presentation.dto.req.UserSignUpApiReq;
import io.oeid.mogakgo.domain.user.presentation.dto.req.UserUpdateApiReq;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserDevelopLanguageApiRes;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserMatchingStatus;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserPublicApiResponse;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserSignUpApiResponse;
import io.oeid.mogakgo.domain.user.presentation.dto.res.UserUpdateApiRes;
Expand All @@ -27,6 +29,7 @@
public class UserController implements UserSwagger {

private final UserService userService;
private final UserMatchingService userMatchingService;

@GetMapping
public ResponseEntity<UserPublicApiResponse> userGetApi(@UserId Long userId) {
Expand Down Expand Up @@ -60,4 +63,10 @@ public ResponseEntity<Void> userDeleteApi(@UserId Long userId) {
userService.deleteUser(userId);
return ResponseEntity.ok().build();
}

@GetMapping("/matching-status")
public ResponseEntity<UserMatchingStatus> userMatchingStatusApi(@UserId Long userId) {
return ResponseEntity.ok(
new UserMatchingStatus(userMatchingService.hasProgressMatching(userId)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.oeid.mogakgo.domain.user.presentation.dto.res;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Schema(description = "매칭 상태를 나타내는 응답")
@Getter
public class UserMatchingStatus {

@Schema(description = "매칭 상태")
private boolean matchingStatus;

public UserMatchingStatus(boolean matchingStatus) {
this.matchingStatus = matchingStatus;
}
}
Loading