youtube 계정 연결 작업 완료
This commit is contained in:
1 parent
c92d6e2135
commit
ef203dc14d
22 files changed
+4521
No files matched your search
@@ -17,6 +17,8 @@ from app.user.api.routers.v1.auth import router as auth_router, test_router as a
|
||||
from app.lyric.api.routers.v1.lyric import router as lyric_router
|
||||
from app.song.api.routers.v1.song import router as song_router
|
||||
from app.video.api.routers.v1.video import router as video_router
|
||||
from app.social.api.routers.v1.oauth import router as social_oauth_router
|
||||
from app.social.api.routers.v1.upload import router as social_upload_router
|
||||
from app.utils.cors import CustomCORSMiddleware
|
||||
from config import prj_settings
|
||||
|
||||
@@ -151,6 +153,55 @@ tags_metadata = [
|
||||
- created_at 기준 내림차순 정렬됩니다.
|
||||
- 삭제는 소프트 삭제(is_deleted=True) 방식으로 처리되며, 데이터 복구가 가능합니다.
|
||||
- 삭제 대상: Video, SongTimestamp, Song, Lyric, Image, Project
|
||||
""",
|
||||
},
|
||||
{
|
||||
"name": "Social OAuth",
|
||||
"description": """소셜 미디어 계정 연동 API
|
||||
|
||||
**인증: 필요** - `Authorization: Bearer {access_token}` 헤더 필수
|
||||
|
||||
## 지원 플랫폼
|
||||
|
||||
- **YouTube**: Google OAuth 2.0 기반 연동
|
||||
|
||||
## 연동 흐름
|
||||
|
||||
1. `GET /social/oauth/{platform}/connect` - OAuth 인증 URL 획득
|
||||
2. 사용자를 auth_url로 리다이렉트 → 플랫폼 로그인
|
||||
3. 플랫폼에서 권한 승인 후 콜백 URL로 리다이렉트
|
||||
4. 연동 완료 후 프론트엔드로 리다이렉트
|
||||
|
||||
## 계정 관리
|
||||
|
||||
- `GET /social/oauth/accounts` - 연동된 계정 목록 조회
|
||||
- `DELETE /social/oauth/{platform}/disconnect` - 계정 연동 해제
|
||||
""",
|
||||
},
|
||||
{
|
||||
"name": "Social Upload",
|
||||
"description": """소셜 미디어 영상 업로드 API
|
||||
|
||||
**인증: 필요** - `Authorization: Bearer {access_token}` 헤더 필수
|
||||
|
||||
## 사전 조건
|
||||
|
||||
- 해당 플랫폼에 계정이 연동되어 있어야 합니다
|
||||
- 영상이 completed 상태여야 합니다
|
||||
|
||||
## 업로드 흐름
|
||||
|
||||
1. `POST /social/upload` - 업로드 요청 (백그라운드 처리)
|
||||
2. `GET /social/upload/{upload_id}/status` - 업로드 상태 폴링
|
||||
3. `GET /social/upload/history` - 업로드 이력 조회
|
||||
|
||||
## 업로드 상태
|
||||
|
||||
- `pending`: 업로드 대기 중
|
||||
- `uploading`: 업로드 진행 중
|
||||
- `processing`: 플랫폼에서 처리 중
|
||||
- `completed`: 업로드 완료
|
||||
- `failed`: 업로드 실패
|
||||
""",
|
||||
},
|
||||
]
|
||||
@@ -218,6 +269,7 @@ def custom_openapi():
|
||||
"/crawling",
|
||||
"/autocomplete",
|
||||
"/search", # 숙박 검색 자동완성
|
||||
"/social/oauth/youtube/callback", # OAuth 콜백 (플랫폼에서 직접 호출)
|
||||
]
|
||||
|
||||
# 보안이 필요한 엔드포인트에 security 적용
|
||||
@@ -267,6 +319,8 @@ app.include_router(lyric_router)
|
||||
app.include_router(song_router)
|
||||
app.include_router(video_router)
|
||||
app.include_router(archive_router) # Archive API 라우터 추가
|
||||
app.include_router(social_oauth_router, prefix="/social") # Social OAuth 라우터 추가
|
||||
app.include_router(social_upload_router, prefix="/social") # Social Upload 라우터 추가
|
||||
|
||||
# DEBUG 모드에서만 테스트 라우터 등록
|
||||
if prj_settings.DEBUG:
|
||||
|
||||
Reference in new issue
Block a user