feat: Add base project structure with API and web components
This commit is contained in:
17
api/app/controllers/service/__init__.py
Normal file
17
api/app/controllers/service/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""Service API Controllers - 基于 API Key 认证的服务接口
|
||||
|
||||
路由前缀: /v1
|
||||
认证方式: API Key
|
||||
"""
|
||||
from fastapi import APIRouter
|
||||
from . import app_api_controller, rag_api_controller, memory_api_controller
|
||||
|
||||
# 创建 V1 API 路由器
|
||||
service_router = APIRouter()
|
||||
|
||||
# 注册子路由
|
||||
service_router.include_router(app_api_controller.router)
|
||||
service_router.include_router(rag_api_controller.router)
|
||||
service_router.include_router(memory_api_controller.router)
|
||||
|
||||
__all__ = ["service_router"]
|
||||
16
api/app/controllers/service/app_api_controller.py
Normal file
16
api/app/controllers/service/app_api_controller.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""App 服务接口 - 基于 API Key 认证"""
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.db import get_db
|
||||
from app.core.response_utils import success
|
||||
from app.core.logging_config import get_business_logger
|
||||
|
||||
router = APIRouter(prefix="/v1/apps", tags=["V1 - App API"])
|
||||
logger = get_business_logger()
|
||||
|
||||
|
||||
@router.get("")
|
||||
async def list_apps():
|
||||
"""列出可访问的应用(占位)"""
|
||||
return success(data=[], msg="App API - Coming Soon")
|
||||
16
api/app/controllers/service/memory_api_controller.py
Normal file
16
api/app/controllers/service/memory_api_controller.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""Memory 服务接口 - 基于 API Key 认证"""
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.db import get_db
|
||||
from app.core.response_utils import success
|
||||
from app.core.logging_config import get_business_logger
|
||||
|
||||
router = APIRouter(prefix="/memory", tags=["V1 - Memory API"])
|
||||
logger = get_business_logger()
|
||||
|
||||
|
||||
@router.get("")
|
||||
async def get_memory_info():
|
||||
"""获取记忆服务信息(占位)"""
|
||||
return success(data={}, msg="Memory API - Coming Soon")
|
||||
16
api/app/controllers/service/rag_api_controller.py
Normal file
16
api/app/controllers/service/rag_api_controller.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""RAG 服务接口 - 基于 API Key 认证"""
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.db import get_db
|
||||
from app.core.response_utils import success
|
||||
from app.core.logging_config import get_business_logger
|
||||
|
||||
router = APIRouter(prefix="/knowledge", tags=["V1 - RAG API"])
|
||||
logger = get_business_logger()
|
||||
|
||||
|
||||
@router.get("")
|
||||
async def list_knowledge():
|
||||
"""列出可访问的知识库(占位)"""
|
||||
return success(data=[], msg="RAG API - Coming Soon")
|
||||
Reference in New Issue
Block a user