Feat: 카테고리 데이터 및 조회/생성 API 구현 (#196) #197
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 개요
PostCategory) 관련 기능을 추가했습니다.🔨 작업 내용
1. 엔티티 수정
PostCategory에CategoryType(enum) 필드 추가CategoryType:SUBJECT,DEMOGRAPHIC,GROUP_SIZEname,name + type)2. 초기 데이터 설정
data.sql을 통해 90여 개의 기본 카테고리 자동 등록application-dev.yml에서defer-datasource-initialization: true,sql.init.mode: always설정3. API 구현
카테고리 전체 조회 (GET /api/posts/categories)
CategoryResponse에type필드 포함카테고리 생성 (POST /api/posts/categories)
409 Conflict, 존재하지 않는 사용자 시404 Not Found처리4. 예외 코드 추가
POST_003POST_0045. Swagger 문서
PostCategoryControllerDocs인터페이스 작성6. 테스트
🔗 관련 이슈
Closes #196
📝 참고 사항
PostCategory에type필드 추가 -> 노션 ERD 페이지에 추가해두었습니다.data.sql이 자동 실행되어 기본 카테고리가 등록됩니다.✅ 체크리스트