Skip to content

Commit

Permalink
[FEAT] 현재 회원 매칭 상태 확인하는 기능 구현 (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
happyjamy authored Feb 26, 2024
1 parent 21052b9 commit 5acd6c4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
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;
}
}

0 comments on commit 5acd6c4

Please sign in to comment.