결정(9/21): 공용 하나, 개인 로컬 없음.
- backend apps/snippets: Snippet(name PK·desc·body·category) + SnippetUsage(사람별 count/last_used).
GET/POST /api/v1/snippets, PUT/DELETE /snippets/{name}, POST /snippets/{name}/use — 옛 브릿지 5개와 1:1,
이름 정규화·중복 409·빈 내용 400 규칙 동일. import_snippets 커맨드로 옛 snippets.db 적재. 테스트 3개
- frontend snippets.api.ts 만 HTTP 로 교체(훅·페이지·타입 무변경). 테스트 axios-mock-adapter 로
- ponytail: Tauri 로컬 SQLite 커맨드는 미사용 상태로 남김. 지울 때 Rust+브릿지 테스트 함께
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
"""최상위 URL — 프론트 VITE_API_BASE_URL(/api/v1) 아래에 매닮."""
|
|
|
|
from django.conf import settings
|
|
from django.contrib import admin
|
|
from django.http import JsonResponse
|
|
from django.urls import include, path
|
|
|
|
from apps.accounts.views import MeView
|
|
from common.envelope import envelope
|
|
|
|
|
|
def health(_request):
|
|
return JsonResponse(
|
|
envelope(success=True, status_code=200, data={"app": settings.APP_NAME, "version": settings.APP_VERSION})
|
|
)
|
|
|
|
|
|
urlpatterns = [
|
|
path("admin/", admin.site.urls),
|
|
path("api/v1/health", health),
|
|
path("api/v1/auth/", include("apps.accounts.urls")),
|
|
path("api/v1/users/me", MeView.as_view()),
|
|
path("api/v1/chat/", include("apps.chat.urls")),
|
|
path("api/v1/admin/", include("apps.stats.urls")), # 관리자 대시보드 집계
|
|
path("api/v1/snippets", include("apps.snippets.urls")), # 공용 스니펫(PostgreSQL). 슬래시 없이 — 프론트가 /snippets 로 침
|
|
path("", include("apps.gateway.urls")), # /api/ito/* — 사내 LLM(FabriX) 중계
|
|
]
|