-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/#2 투표 토글 및 투표 개수 조회 api 구현 #61
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
Merged
The head ref may contain hidden characters: "Feature/#2-\uD22C\uD45C_\uD1A0\uAE00_\uBC0F_\uD22C\uD45C_\uAC1C\uC218_\uC870\uD68C_API_\uAD6C\uD604"
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
033264b
feat : 투표 토글 및 투표 개수 조회 API 구현 완료
pykido 8654878
feat : 투표 토글 및 투표 개수 조회 API 테스트 코드 구현 완료
pykido 59f306f
feat : 투표 토글 및 투표 개수 조회 API 테스트 코드 구현 완료
pykido 73c0cb5
refactor : 코파일럿 리뷰 반영 - 1
pykido aad916b
refactor : 지민님 & 성재님 리뷰 반영 완료
pykido 2153061
refactor : 테스트 코드 추가 및 Docs 동기화
pykido 287b665
refactor : URL 경로 개선
pykido 4aa0fde
Merge branch 'develop' into Feature/#2-투표_토글_및_투표_개수_조회_API_구현
pykido 8157e20
refactor : 테이블 유니크 제약조건 추가
pykido 7052e3c
refactor : queryservice로의 분리 및 테스트 코드 작성
pykido 0a62b70
refactor : 파일 구분 깔끔하게
pykido 850109f
refactor : api docs 수정 완료
pykido bfe672e
Merge branch 'develop' into Feature/#2-투표_토글_및_투표_개수_조회_API_구현
pykido File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
203 changes: 203 additions & 0 deletions
203
src/main/java/com/opus/opus/docs/asciidoc/team-vote.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,203 @@ | ||
| ifndef::snippets[] | ||
| :snippets: ./build/generated-snippets | ||
| endif::[] | ||
|
|
||
| = TEAM VOTE API 문서 | ||
| :doctype: book | ||
| :icons: font | ||
| :source-highlighter: highlightjs | ||
| :toc: left | ||
| :toclevels: 3 | ||
| :sectnums: | ||
|
|
||
| == API 목록 | ||
|
|
||
| link:./opus.html[API 목록으로 돌아가기] | ||
|
|
||
| == `PUT`: 팀 투표 토글 | ||
|
|
||
| 해당 팀에 대해 투표 상태를 토글합니다. | ||
|
|
||
| * `isVoted: true` → 투표 등록 | ||
| * `isVoted: false` → 투표 취소 | ||
|
|
||
| NOTE: 대회 기간 중에는 투표만 보이고, 대회 기간이 아니라면 좋아요가 보입니다. | ||
|
|
||
| NOTE: 해당 대회의 최대 투표 개수 이상으로 투표를 등록할 수 없습니다. | ||
|
|
||
| .Path Parameters | ||
| include::{snippets}/toggle-team-vote/path-parameters.adoc[] | ||
|
|
||
| .HTTP Request Headers | ||
| include::{snippets}/toggle-team-vote/request-headers.adoc[] | ||
|
|
||
| .Request Fields | ||
| include::{snippets}/toggle-team-vote/request-fields.adoc[] | ||
|
|
||
| .Response Fields | ||
| include::{snippets}/toggle-team-vote/response-fields.adoc[] | ||
|
|
||
| === 시나리오 1: TeamVote 데이터가 없는 경우 | ||
|
|
||
| 특정 멤버가 특정 팀에 대해 투표 API를 처음 호출하면, TeamVote 테이블에 데이터가 새로 생성됩니다. | ||
|
|
||
| [cols="1,2,1"] | ||
| |=== | ||
| |Request isVoted |응답 메시지 |HTTP 상태 코드 | ||
|
|
||
| |true | ||
| |투표가 등록되었습니다. | ||
| |200 OK | ||
|
|
||
| |false | ||
| |아직 투표하지 않은 팀입니다. | ||
| |400 Bad Request | ||
| |=== | ||
|
|
||
| isVoted: true → 투표 등록 | ||
|
|
||
| include::{snippets}/toggle-team-vote/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote/http-response.adoc[] | ||
|
|
||
| === 시나리오 2: TeamVote 데이터가 있는 경우 | ||
|
|
||
| 이미 해당 팀에 대한 투표 기록이 있는 경우, 상태에 따라 토글됩니다. | ||
|
|
||
| [cols="1,1,2,1"] | ||
| |=== | ||
| |현재 isVoted |Request isVoted |응답 메시지 |HTTP 상태 코드 | ||
|
|
||
| |true | ||
| |true | ||
| |이미 투표한 팀입니다. | ||
| |400 Bad Request | ||
|
|
||
| |true | ||
| |false | ||
| |투표가 취소되었습니다. | ||
| |200 OK | ||
|
|
||
| |false | ||
| |true | ||
| |투표가 등록되었습니다. | ||
| |200 OK | ||
|
|
||
| |false | ||
| |false | ||
| |이미 투표를 취소한 팀입니다. | ||
| |400 Bad Request | ||
| |=== | ||
|
|
||
| 투표 취소 (isVoted: true → false) | ||
|
|
||
| include::{snippets}/cancel-team-vote/http-request.adoc[] | ||
|
|
||
| include::{snippets}/cancel-team-vote/http-response.adoc[] | ||
|
|
||
| === ⚠️ 실패 케이스 | ||
|
|
||
| .❌ Case 1: 존재하지 않는 팀 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-not-found/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-not-found/http-response.adoc[] | ||
|
|
||
| ==== | ||
|
|
||
| .❌ Case 2: 이미 투표한 팀 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-already-voted/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-already-voted/http-response.adoc[] | ||
|
|
||
| ==== | ||
|
|
||
| .❌ Case 3: 이미 투표 취소한 팀 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-already-unvoted/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-already-unvoted/http-response.adoc[] | ||
|
|
||
| ==== | ||
|
|
||
| .❌ Case 4: 투표한 적 없는 팀에 취소 요청 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-not-voted-yet/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-not-voted-yet/http-response.adoc[] | ||
|
|
||
| ==== | ||
|
|
||
| .❌ Case 5: 최대 투표 수 초과 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-limit-exceeded/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-limit-exceeded/http-response.adoc[] | ||
|
|
||
| ==== | ||
|
|
||
| .❌ Case 6: 투표 기간이 아님 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-not-vote-period/http-request.adoc[] | ||
|
|
||
| include::{snippets}/toggle-team-vote-fail-not-vote-period/http-response.adoc[] | ||
|
|
||
| ==== | ||
|
|
||
| == `GET`: 사용자 투표 개수 조회 | ||
|
|
||
| 현재 사용자가 특정 대회에서 남은 투표 가능 횟수와 최대 투표 허용 개수를 조회합니다. | ||
|
|
||
| .Query Parameters | ||
| include::{snippets}/get-member-vote-count/query-parameters.adoc[] | ||
|
|
||
| .HTTP Request Headers | ||
| include::{snippets}/get-member-vote-count/request-headers.adoc[] | ||
|
|
||
| .HTTP Request | ||
| include::{snippets}/get-member-vote-count/http-request.adoc[] | ||
|
|
||
| .HTTP Response | ||
| include::{snippets}/get-member-vote-count/http-response.adoc[] | ||
|
|
||
| .Response Fields | ||
| include::{snippets}/get-member-vote-count/response-fields.adoc[] | ||
|
|
||
| === ⚠️ 실패 케이스 | ||
|
|
||
| .❌ Case 1: 존재하지 않는 대회 | ||
|
|
||
| [%collapsible] | ||
|
|
||
| ==== | ||
|
|
||
| include::{snippets}/get-member-vote-count-fail-not-found/http-request.adoc[] | ||
|
|
||
| include::{snippets}/get-member-vote-count-fail-not-found/http-response.adoc[] | ||
|
|
||
| ==== | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.