Conversation
…s에 업로드 및 반환값 dto 추가
값 수정 기능은 추후 JWT 이용해서 접근하는 유저의 id를 가져와 메타데이터의 id와 동일한 경우에만 수정 가능하게 변경 할 예정
…를 기반으로 보안처리 및 유저 식별하여 코드 실행하게 수정
DB에 메타데이터로 해시값을 저장함 에 따라 과정, 코드 간결화 하기 위함 + 혹시 모를 오류 방지를 위해 업로드 시 핀 설정은 해제 상태로 업로드(추후 운영단계에서 true로 수정)
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.
[feat] IPFS 연동을 통한 캡슐 컨텐츠 업로드 및 메타데이터 저장
😺 Issue
✅ 작업 리스트
⚙️ 작업 내용
메타데이터는 클라이언트에서 title, description, category 와 같은 요소를 넘겨 받고 컨텐츠를 IPFS에 업로드 후 hash, fileName, fileSize 를 받아 둘을 결합하여 DB에 저장하며, userid를 입력해 소유자가 누구인지 식별
METADATA_NOT_FOUND, FILE_NOT_FOUND, ACCESS_DENIED 등의 커스텀 에러를 추가
IpfsClient에서는 RestTemplate의 post를 사용해서 업로드, 다운로드, 핀해제 등의 요소를 처리
application.yml 에 ipfs url 속성을 추가해 env 파일의 값만 바꾸면 전체에 반영됨
SecurityUtil 의 getCurrentUsername 과 UserService 에 추가된 getUserIdByUsername 을 통해 ContentController에서 userid를 jwt를 통해서 추출하여 사용
📷 테스트 / 구현 내용