feat: 시술기록 사진 파일 교체 지원 - #139
Merged
Merged
Conversation
photo_id 를 유지한 채 file_id 만 바꿀 수 있어야 한다. 삭제 후 재등록으로 교체하면 식별자가 바뀌어 표시 순서와 이 사진을 참조하는 분석 결과가 끊긴다.
교체 파일은 요청자 소유의 READY 파일이어야 하고, 다른 사진이 이미 쓰는 파일은 붙이지 않는다 — 한 파일을 둘이 공유하면 한쪽을 지울 때 파일이 정리 대상이 되어 남은 사진이 깨진다. AFTER 사진의 내용이 바뀌면 그 사진으로 낸 분석 결과를 stale 로 표시한다.
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.
관련 이슈
변경 내용
PATCH /treatment-records/{recordId}/photos/{photoId}가file_id를 받아 사진이 가리키는 파일을 교체photo_id는 유지 — 표시 순서와 이 사진을 참조하는 분석 결과가 끊기지 않는다409 FILE_INVALID_STATEtreatment_record_photos.file_id의 JPAupdatable = false해제작업 목적
사진 자체를 바꾸는 경로가 없어 클라이언트가 새 사진을 추가하는 것 말고는 방법이 없었다. 사진이 중복으로 쌓이고 화면에는 옛 사진이 남는다. 삭제 후 재등록으로 우회하면
photo_id가 바뀌어 순서와 참조가 끊긴다.테스트 방법
체크리스트
기타 사항
POST .../photos에도 같은 구멍이 있지만 기존 동작이라 이 PR 범위 밖이다 — 필요하면 별도 이슈로 다룬다updatable = false는 JPA 매핑 제약이었다POST .../photos를 쓰면 사진이 쌓이므로 앱 쪽에서 이 엔드포인트로 옮겨야 한다