Skip to content
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

Clova GreenEye API 요청 #241

Merged
merged 9 commits into from
Dec 11, 2023
Merged

Clova GreenEye API 요청 #241

merged 9 commits into from
Dec 11, 2023

Conversation

5tarry
Copy link
Collaborator

@5tarry 5tarry commented Dec 9, 2023

resolved: #237

작업 내용

  • clova greeneye api 요청
  • ffmpeg으로 비디오 랜덤 프레임 추출
  • cloud function action, api gateway와 연결

전달 사항

  • client에서 인코딩 요청 시 server가 greeneye action을 실행하여, action에서 ffmpeg으로 screenshot을 4개 생성한 뒤 clova greeneye api를 요청하여 유해성 검사를 하고, 유해성 검사 결과 normal이 0.5 이하일 경우 server에게 delete /videos/{id} 요청을 합니다.

@5tarry 5tarry added backend feat 새로운 기능 추가 labels Dec 9, 2023
@5tarry 5tarry added this to the Week 5 milestone Dec 9, 2023
@5tarry 5tarry requested a review from msjang4 December 9, 2023 16:57
@5tarry 5tarry self-assigned this Dec 9, 2023
msjang4
msjang4 previously approved these changes Dec 10, 2023
Copy link
Collaborator

@msjang4 msjang4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

유해이미지 검사 액션과 delete API간을 필요한 파라미터들을 잘 고려해주신 거 같아요
프로젝트 마감이 얼마 남지 않아서 지금은 넘어가는게 맞지만 ㅜㅜ 제 생각에는 admin용 token을 만들어서 액션에 유저 jwt를 넘겨주지 않고 delete API에서도 admin인 경우 업로더 본인체크를 안하는 건 어떤가 싶네요 🤔
전체적으로 너무 좋은 코드예요! 고생하셨어요 감사합니다 🙇🏻‍♂️

Comment on lines +22 to +23
// eslint-disable-next-line no-await-in-loop
const result = await greenEye(file, file, imageData, greenEyeSecret);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for문에서는 await를 하지 않는게 권장이군여
promise 패턴과 재귀를 활용해보면 좋을 수도..? 제가 한번 고민해볼게요

server/src/ncpAPI/cloud-function/greeneye-action.js Outdated Show resolved Hide resolved
}
}

const createScreanshots = async (videoUrl) => {
Copy link
Collaborator

@msjang4 msjang4 Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수 내에서 await를 안하면 async를 안붙여도 되는데 이 함수처럼 promise를 리턴하는 경우 명시성을 위해 일부러 붙여주기도 하더라고요! 그런 점을 고려하신건지 궁금해요~

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흠 아마 깊게 고려하진 않았던 것 같아요

@msjang4 msjang4 self-requested a review December 11, 2023 01:45
msjang4
msjang4 previously approved these changes Dec 11, 2023
@@ -21,7 +21,7 @@ export class AuthGuard implements CanActivate {
}
try {
const payload = await this.jwtService.verifyAsync(token);
request.user = payload;
request.user = { ...payload };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 ㅎㅎ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 이건 token 추가하려고 이렇게 했었어요 ㅎㅎ

server/src/auth/auth.service.ts Show resolved Hide resolved
server/src/video/video.service.ts Show resolved Hide resolved
@msjang4 msjang4 merged commit c064244 into develop Dec 11, 2023
@5tarry 5tarry deleted the feat/greeneye_api branch December 11, 2023 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend feat 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Backend] Clova GreenEye API
2 participants