Repository navigation
Conversation
과제 3절에서 정한 @AdminAction, AdminActionType, AdminTargetType 을 그대로 둔다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 쌓기만 하는 표. @immutable 엔티티, 저장소는 save·search 만 연다(삭제 없음) - 결과는 저장하지 않고 http_status 로 계산(2xx SUCCESS, 4xx REJECTED, 5xx ERROR) - 인덱스: (target_type, target_id, admin_action_log_id), (admin_id, created_at) - 본문·경로 변수·쿼리는 가린 JSON 을 longtext 로 저장 - 커서 방식 조회, 실패만 보기(http_status >= 400) 조건 - V23 은 main 의 V23__ubuntu_accounts.sql(#731)과 겹쳐 V24 를 쓴다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- preHandle 에서 어노테이션을 읽고 afterCompletion 에서 최종 상태 코드로 한 줄 남긴다 - 본문은 RequestBodyAdvice 로 @Valid 전에 잡아 검증 실패(400)도 남긴다 - 실패 응답의 code 를 ResponseBodyAdvice 로 error_code 에 옮긴다 - password·token·secret 이 들어간 칸은 *** 로 가린다(중첩·배열·쿼리 포함) - 별도 트랜잭션(REQUIRES_NEW)으로 저장하고, 실패하면 응답은 그대로 두고 [ADMIN_ACTION_LOG] ERROR 로그를 남긴다 - 저장·가리기 빈은 ObjectProvider 로 받아 @WebMvcTest 조각 테스트를 깨지 않는다 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /api/admin/action-logs: targetType·targetId, adminId, action, from·to, failedOnly, cursor·size(기본 20, 최대 100). /api/admin/** 아래라 관리자만 부를 수 있다. 수정·삭제 경로는 두지 않는다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
컨트롤러 본문은 바꾸지 않고 어노테이션과 import 만 추가했다. 통합 테스트로 성공·400·409 기록, 403·어노테이션 없는 API 미기록, 저장 실패 시 응답 유지, failedOnly 조회를 확인한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
🌱 관련 이슈
🌱 작업 사항
과제 4의 질문에 대한 설계의 답변을 보고서에 정리하고 실제로 구현하였습니다.
내용을 요약하자면 아래와 같습니다.
기록 방식
@AdminAction을 읽고, afterCompletion에서 최종 상태 코드로 한 줄 남깁니다. 성공·검증 실패(400)·업무 규칙 실패(4xx)·서버 오류(5xx)가 모두 남습니다.@Valid전에 잡아 두어, 검증에 실패한 요청도 "무엇을 하려 했는지"가 남습니다.🌱 참고 사항
마이그레이션 번호를 V23을 지정해주셨지만, 작업 중 main에 V23__ubuntu_accounts.sql(#731)이 들어와 겹치지 않도록 V24로 올렸습니다.
401·403는 권한 필터에서 막혀 인터셉터까지 오지 않습니다. 남기려면 'global/auth/**'를 고쳐야 해서 범위 밖으로 두었습니다.
새 코드는 모두 domain/adminActionLog에 있고, 기존 코드는 컨트롤러 19곳에
@AdminAction한 줄과 import만 더했습니다.좀 더 자세한 사항은 보고서에 작성해두었습니다.