-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 게시글 본문 이미지 업로드/다운로드 기능 추가 #445
The head ref may contain hidden characters: "feature/gusah009/#109-\uAC8C\uC2DC\uAE00-\uC774\uBBF8\uC9C0-\uC5C5\uB85C\uB4DC-\uAE30\uB2A5"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~~!!
선배님 덕분에 이슈 2일만에 23에서 6으로 줄였네요!! 감사합니다 감사합니다
@RequestPart MultipartFile file | ||
) { | ||
FileEntity fileEntity = postService.uploadFileForContent(file); | ||
log.info("member \"{}\" uploaded file. memberId: {}, fileId: {}", member.getRealName(), member.getId(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그 남기는 이유가 뭔가요?? 또, 보통 하나의 메서드에 로그 하나씩은 남기는 편인가요?
제가 로그를 남겨본적이 없어서..ㅎㅎ 여쭤봅니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 보통은 로그를 따로 안남기는데 이 API 같은 경우는 게시글 본문에 이미지를 올리기만 하면 업로드가 되어서 서버 용량에 영향을 미치기가 쉬운 API라 혹시나 모를 어뷰징에 대비해 로그를 남겨놨습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다... 오랜만에 스프링 코드 보니까 어렵네요
public void 유효한_요청일_경우_게시글_본문_파일_업로드는_성공한다() throws Exception { | ||
String securedValue = getSecuredValue(PostController.class, "uploadFileForContent"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getSecuredValue
아직 쓰이고 있었군요 ㄷㄷ
.ipAddress(ipAddress) | ||
.fileHash(getRandomUUID()) | ||
.build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileHash
말고 fileUUID
는 별로일까요? ㅋㅋ
hash는 일반적으로 MD5
, SHA1
, SHA256
을 생각하게 되는데, 처음부터 uuid라고 명시하면 좋을 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileUUID로 수정해놓겠습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~!!
@gusah009 |
🔥 Related Issue
📝 Description
게시글 본문용 이미지 업로드/다운로드 기능 추가
이미지 다운로드는 file hash를 이용하도록 했습니다.
⭐️ Review Request