feat: Post 비공개 기능 추가
Some checks failed
Build And Test / build-and-push (push) Has been cancelled

- Post 모델에 is_private 필드 추가
- 비공개 게시글은 작성자만 목록/상세에서 조회 가능
- 공개/비공개 토글 기능 지원

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-25 12:56:05 +09:00
parent c02851e4d3
commit d87d70997b
5 changed files with 59 additions and 7 deletions

View File

@ -108,7 +108,8 @@ class PostSerializer(serializers.ModelSerializer):
'author_id', 'author_name',
'created_at', 'updated_at',
'comment_count', 'tags', 'tag_names',
'attachments', 'attachment_ids'
'attachments', 'attachment_ids',
'is_private'
]
read_only_fields = ['author_id', 'author_name', 'created_at', 'updated_at']
@ -178,7 +179,8 @@ class PostListSerializer(serializers.ModelSerializer):
fields = [
'id', 'title',
'author_name', 'created_at', 'updated_at',
'comment_count', 'tags', 'thumbnail'
'comment_count', 'tags', 'thumbnail',
'is_private'
]
def get_comment_count(self, obj):