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 1 commit
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 @@ -5,6 +5,7 @@
import io.oeid.mogakgo.core.properties.swagger.error.SwaggerUserErrorExamples;
import io.oeid.mogakgo.domain.user.presentation.dto.req.UserSignUpApiRequest;
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.exception.dto.ErrorResponse;
Expand Down Expand Up @@ -80,4 +81,8 @@ 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);
}
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,9 +2,11 @@

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.presentation.dto.req.UserSignUpApiRequest;
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 jakarta.validation.Valid;
Expand All @@ -24,6 +26,7 @@
public class UserController implements UserSwagger {

private final UserService userService;
private final UserMatchingService userMatchingService;

@GetMapping
public ResponseEntity<UserPublicApiResponse> userGetApi(@UserId Long userId) {
Expand All @@ -50,4 +53,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;
}
}