Skip to content

✨ 풀이 기록 조회 API 확장 및 타인 제출 404 처리 - #47

Merged
s26059-maker merged 2 commits into
developfrom
feat/submission-history
Oct 12, 2026
Merged

s26059-maker merged 2 commits into
developfrom
feat/submission-history

Conversation

@s26059-maker

Copy link
Copy Markdown
Contributor

개요

학습 모드 대신 제공하기로 한 "내 풀이 기록" 기능입니다. 기존 GET /submissions/me를 확장하고 상세 경로를 정리합니다.

API 변경

항목 변경 전 변경 후
목록 GET /submissions/me submissionId, problemId, language, verdict, score, submittedAt + problemTitle, difficulty, aiScore
상세 GET /submissions/{id} GET /submissions/me/{id} (기존 경로 제거)
타인 제출 조회 403 404 (SUBMISSION_NOT_FOUND)
/{id}/feedback 403 404 (경로 유지)
  • aiScore = time + readability + originality 합계, 하나라도 null이면 null
  • PENDING 제출도 목록에 표시 (오답 집계 제외 규칙과는 별개)
  • 정렬은 최신순 고정, size 최대 100
  • 존재하지 않는 제출과 남의 제출이 같은 404를 반환해서 존재 여부가 노출되지 않음
  • 쓰지 않게 된 SubmissionAccessDeniedException과 핸들러 삭제

프론트가 아직 API 연결 전이라 호환성 영향은 없습니다. Notion 명세도 반영했습니다.
(기존 명세의 roundId 필터는 코드에 없어서 명세에서 제거)

성능

  • 목록: JPQL 인터페이스 프로젝션 + join → 목록 1회 + count 1회 = 2쿼리 (문제 수와 무관, N+1 제거)
  • 상세: fetch join 1쿼리
  • V14__submission_user_submitted_at_index.sql: (user_id, submitted_at) 복합 인덱스 추가
    • EXPLAIN 결과 인덱스를 사용하고 filesort 없음 확인

테스트

  • 신규 16건: 본인 목록, 페이징, 쿼리 수(Hibernate 통계), aiScore 계산, 타인 상세 404, 없는 제출과 응답 동일, /feedback 404
  • 전체 228건, 실패 0건 (외부 서비스가 필요한 IT 2건 skip)
  • V14는 빈 MySQL에서 V1부터 전체 적용 + validate 통과

⚠️ 머지 순서

feat/rename-topic-order(V13) 머지 후 develop을 rebase하고 머지해주세요.

리뷰 요청

  • @양지우: 프론트 연결할 때 상세 경로(/me/{id})와 404 처리 참고

s26059-maker and others added 2 commits October 12, 2026 20:18
- GET /submissions/me: problemTitle, difficulty, aiScore 추가. JPQL 프로젝션 + join으로
  N+1 없이 목록 1회 + count 1회로 조회. 정렬은 최신순(submittedAt desc, id desc)으로 고정하고
  클라이언트 sort는 무시, size는 최대 100
- GET /submissions/me/{id} 추가(기존 /{id}와 같은 응답). problem은 fetch join으로 1회 조회
- 타인 제출 조회를 403에서 404(SUBMISSION_NOT_FOUND)로 변경 — /{id}, /{id}/feedback 포함.
  SubmissionAccessDeniedException과 핸들러 제거
- aiScore = time+readability+originality 합, 하나라도 없으면 null
- V14: submission (user_id, submitted_at) 복합 인덱스
- 테스트: 본인 목록/페이징/PENDING 포함/쿼리 수/aiScore/타인 상세 404

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- 프론트가 아직 API 연결 전이라 호환 별칭 없이 상세 조회를 /submissions/me/{id}로만 제공
- /submissions/{id}/feedback은 유지하고 타인 제출 404 규칙만 유지
- 테스트: 옛 경로가 더 이상 응답하지 않음, feedback 타인 제출 404

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@s26059-maker
s26059-maker force-pushed the feat/submission-history branch from 9783051 to 075be5a Compare October 12, 2026 11:18
@s26059-maker
s26059-maker merged commit e75deeb into develop Oct 12, 2026
1 check passed
@s26059-maker
s26059-maker deleted the feat/submission-history branch October 12, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant