Skip to content

Commit

Permalink
Merge pull request #15 from kduoh99/Feat/#14
Browse files Browse the repository at this point in the history
Feat: AI ํŒ€ ๋นŒ๋”ฉ ์ค‘๋ณต ๊ฒ€์‚ฌ ๊ตฌํ˜„
  • Loading branch information
kduoh99 authored Nov 1, 2024
2 parents 8ed902f + e69b6ac commit 2a746e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/hackathon/momento/team/api/TeamController.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,19 @@ public RspTemplate<List<TeamInfoResDto>> getTeamInfoProfile() {
List<TeamInfoResDto> teamProfile = teamService.getTeamInfoProfile(TEMP_MEMBER_ID);
return new RspTemplate<>(HttpStatus.OK, "ํŒ€ ์ •๋ณด ์กฐํšŒ ์„ฑ๊ณต", teamProfile);
}

@PostMapping("/check-duplicate")
@Operation(
summary = "AI ํŒ€ ๋นŒ๋”ฉ ์š”์ฒญ ์ค‘๋ณต ๊ฒ€์‚ฌ",
description = "์‚ฌ์šฉ์ž์˜ AI ํŒ€ ๋นŒ๋”ฉ ์š”์ฒญ์ด ์กด์žฌํ•˜๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค.",
responses = {
@ApiResponse(responseCode = "200", description = "์ค‘๋ณต ๊ฒ€์‚ฌ ์„ฑ๊ณต"),
@ApiResponse(responseCode = "400", description = "์ž˜๋ชป๋œ ์š”์ฒญ"),
@ApiResponse(responseCode = "500", description = "์„œ๋ฒ„ ์˜ค๋ฅ˜")
}
)
public RspTemplate<String> checkDuplicateRequest() {
boolean isDuplicate = teamService.checkDuplicate(TEMP_MEMBER_ID);
return new RspTemplate<>(HttpStatus.OK, String.valueOf(isDuplicate));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,11 @@ public List<TeamInfoResDto> getTeamInfoProfile(Long memberId) {
.map(TeamInfoResDto::from)
.collect(Collectors.toList());
}

public boolean checkDuplicate(Long memberId) {
Member member = memberRepository.findById(memberId)
.orElseThrow(MemberNotFoundException::new);

return teamBuildingRepository.existsByMemberAndStatus(member, Status.PENDING);
}
}

0 comments on commit 2a746e9

Please sign in to comment.