feat: Attachment 모델 추가 및 관련 기능 구현
All checks were successful
Build And Test / build-and-push (push) Successful in 2m5s
All checks were successful
Build And Test / build-and-push (push) Successful in 2m5s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
19
blog/urls.py
19
blog/urls.py
@ -2,7 +2,12 @@
|
||||
|
||||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from .views import PostListView, PostListCreateView, PostDetailView, CommentViewSet, TagListView
|
||||
from .views import (
|
||||
PostListView, PostListCreateView, PostDetailView,
|
||||
CommentViewSet, TagListView,
|
||||
AttachmentListCreateView, AttachmentDeleteView,
|
||||
TempAttachmentUploadView, TempAttachmentDeleteView
|
||||
)
|
||||
|
||||
# 댓글 라우터
|
||||
comment_router = DefaultRouter()
|
||||
@ -19,4 +24,16 @@ urlpatterns = [
|
||||
|
||||
# 댓글 관련 (포스트 하위 리소스)
|
||||
path('posts/<int:post_pk>/', include(comment_router.urls)),
|
||||
|
||||
# 첨부파일 관련
|
||||
path('posts/<int:post_pk>/attachments/',
|
||||
AttachmentListCreateView.as_view(), name='attachment-list'),
|
||||
path('posts/<int:post_pk>/attachments/<int:pk>/',
|
||||
AttachmentDeleteView.as_view(), name='attachment-delete'),
|
||||
|
||||
# 임시 첨부파일 (게시글 작성 전 업로드)
|
||||
path('attachments/upload/',
|
||||
TempAttachmentUploadView.as_view(), name='temp-attachment-upload'),
|
||||
path('attachments/<int:pk>/',
|
||||
TempAttachmentDeleteView.as_view(), name='temp-attachment-delete'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user