Repository navigation
feat: 수능 여론 투표 API와 첫 질문들 - #52
Merged
Merged
Conversation
- 로그인 없이 질문마다 한 번 고르는 투표. 회원은 회원 번호, 아니면 손님 쿠키로 한 사람을 구분하고 IP는 저장하지 않는다 - 고른 뒤에만 결과(전국, 10표 이상 모인 시·도별)를 돌려주고, 닫힌 질문은 누구나 결과를 본다 - 결과 집계는 질문마다 5초씩 기억해 수능 당일 저녁처럼 몰릴 때 DB를 지킨다. 방금 넣은 표는 바로 더해 보여 준다 - 운영 콘솔용 목록·만들기·숨기기/마감 API - D-2, D-1, 수능 당일(16:40 KST에 열림), 수능 다음 날 질문 13개를 마이그레이션으로 넣는다
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
변경
수능 여론 투표 API를 추가합니다. 로그인 없이 질문마다 한 번 고르고, 고른 뒤에 전국·지역별 결과를 봅니다.
공개 API
GET /api/public/polls: 열린 질문, 3일 안에 열릴 질문(투표는 열린 뒤), 닫힌 지 10일 안 된 질문. 내가 고른 답과 결과가 같이 옵니다.POST /api/public/polls/{id}/votes{optionId, geoCountry?, geoRegion?}: 한 표를 넣고 결과를 돌려받습니다. 이미 고른 질문이면 처음 고른 답 그대로 결과만 옵니다.chak_guest_id)로 한 사람을 구분합니다. 쿠키가 없으면 새로 만들어 줍니다(기존 손님 생성 제한 적용).운영 콘솔 API
GET /api/admin/polls,POST /api/admin/polls,PATCH /api/admin/polls/{id}(숨기기, 여는/닫는 시각)처음 넣는 질문 (V20 마이그레이션)
테스트
PollApiTest: 비회원 투표·쿠키 발급, 중복 투표, 투표 전 결과 숨김, 지역 최소 표 수, 열리기 전/마감 후 거절, 숨기기, 다른 질문의 선택지 거절, 운영자만 관리MigrationTest: 수능 당일 질문이 07:40 UTC(16:40 KST)에 열리고 선택지 65개가 들어가는지