Skip to content

[category] 문서 분류 기능 및 API 추가 - #40

Merged
ZaMan0806 merged 5 commits into
feat/article-favorites-apifrom
feat/article-category-api
Oct 13, 2026
Merged

ZaMan0806 merged 5 commits into
feat/article-favorites-apifrom
feat/article-category-api

Conversation

@ZaMan0806

@ZaMan0806 ZaMan0806 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 문서 분류 기능과 API를 추가합니다.

Closes #27

Changes

  • categories 테이블 + articles.category_id(nullable). ArticleJpaEntity.parent(계층)와 별개의 평면 분류로 두었고 parent는 건드리지 않았습니다.
  • POST /api/v1/categories(관리자), GET /api/v1/categories(분류별 문서 수 포함), GET /api/v1/categories/{id}/articles
  • 문서 생성·수정 요청의 categoryId. 수정에서 생략하면 유지(분류를 비우는 기능은 없음). 분류 변경은 리비전을 만들지 않음
  • 문서 응답에 category {id, name} 포함. 읽기 경로(Redis → Mongo)가 MySQL을 보지 않도록 분류를 Mongo 뷰·동기화 이벤트·정합성 복구에 함께 복사
  • 분류 이름은 만든 뒤 바꾸지 않는 것을 전제로 이름을 복사해 둠

Test

  • ./mill test, ./mill spotless --check 통과
  • 분류 생성(관리자·중복·동시), 분류 목록/문서 수, 분류별 문서 목록, 생성·수정 시 분류 지정, 응답 변환 테스트

시안의 실제 분류 체계(학교 / 동아리 / 행사 / 인물)는 관리자가 API로 만들어야 합니다(시드 데이터 없음).

Checklist

  • I checked that this PR matches the project conventions.
  • I ran the relevant tests or explained why they were not run.
  • I updated documentation or configuration when needed.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@ZaMan0806
ZaMan0806 added this pull request to stack #43 October 12, 2026 02:15
@ZaMan0806
ZaMan0806 force-pushed the feat/article-category-api branch from 1650d0a to 6d1f74e Compare October 12, 2026 02:18
@ZaMan0806
ZaMan0806 force-pushed the feat/article-category-api branch from 6d1f74e to 546990a Compare October 12, 2026 02:23
@ZaMan0806
ZaMan0806 force-pushed the feat/article-category-api branch from 546990a to 279eca2 Compare October 12, 2026 02:57
@ZaMan0806
ZaMan0806 force-pushed the feat/article-category-api branch from 279eca2 to 747053f Compare October 12, 2026 03:10
@ZaMan0806
ZaMan0806 force-pushed the feat/article-category-api branch from 747053f to d09d7d3 Compare October 12, 2026 03:13
- 별도 categories 테이블과 articles.category_id 추가 (parent 계층은 건드리지 않음)
- 분류 생성(관리자), 분류 목록(문서 수 포함), 분류별 문서 목록 API
- 문서 생성·수정 시 categoryId 지정, 문서 응답에 분류 포함
- Mongo 읽기 뷰·이벤트·정합성 복구에 분류를 함께 반영

Closes #27
- 정합성 복구 배치와 MySQL 읽기 경로가 분류를 fetch join으로 함께 조회하도록 수정 (트랜잭션 밖에서 category.name 접근 시 LazyInitializationException으로 복구가 조용히 건너뛰어지던 문제)
- 클래스 레벨 @validated를 제거해 범위를 벗어난 page/size가 500 대신 400이 되도록 수정
- 검색 PR(#32)이 ArticleMongoEntity에 필수 필드(searchText)를 추가해도 깨지지 않도록 위치 인자 생성 대신 mock 사용
@ZaMan0806
ZaMan0806 force-pushed the feat/article-category-api branch from d09d7d3 to 985048e Compare October 12, 2026 03:26
@ZaMan0806 ZaMan0806 changed the title feat(category): 문서 분류 기능 및 API 추가 [category] 문서 분류 기능 및 API 추가 Oct 12, 2026
snowykte0426
snowykte0426 previously approved these changes Oct 13, 2026
# Conflicts:
#	src/main/kotlin/io/github/wntopia/gikipedia/server/domain/article/entity/ArticleMongoEntity.kt
@ZaMan0806
ZaMan0806 merged commit e3bbf6f into develop Oct 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants