Skip to content

api-server(raw-posts): raw_posts 도메인 assets pool 전환 + SQL 경로 수정 #338

Description

@cocoyoon

Part of #333.

Scope

기존 raw_posts 도메인(4개 admin 엔드포인트)을 assets DB pool로 전환. 기능/시그니처는 유지.

Deliverables

  • `packages/api-server/src/domains/raw_posts/service.rs`
    • 모든 `db` 인자 호출처를 `state.assets_db.as_ref()` 로 교체
    • raw SQL 문자열의 `warehouse.raw_post_sources`/`warehouse.raw_posts` → `public.raw_post_sources`/`public.raw_posts`
    • 새 `assets_raw_posts` / `assets_raw_post_sources` entity import
  • `packages/api-server/src/domains/raw_posts/handlers.rs`
    • 모든 `state.db.as_ref()` → `state.assets_db.as_ref()`
  • `packages/api-server/src/domains/raw_posts/dto.rs` — status 컬럼을 DTO에 노출할지 판단 (admin UI에서 필터/표시 필요)
  • 기존 4 엔드포인트 회귀 테스트 녹색 유지
    • GET /api/v1/raw-posts/sources
    • POST /api/v1/raw-posts/sources
    • PATCH /api/v1/raw-posts/sources/{id}
    • GET /api/v1/raw-posts/items
    • GET /api/v1/raw-posts/stats

Acceptance

  • `cargo check`, `cargo test --lib domains::raw_posts` 통과
  • 로컬에서 `/api/v1/raw-posts/stats` 200 응답 (cloud assets에 연결됐을 때)

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions