mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: Add Api Docs
This commit is contained in:
@@ -11,7 +11,7 @@ from common.core.deps import SessionDep
|
||||
router = APIRouter(tags=["Table Relation"], prefix="/table_relation")
|
||||
|
||||
|
||||
@router.post("/save/{ds_id}", response_model=List[dict], summary=f"{PLACEHOLDER_PREFIX}tr_save")
|
||||
@router.post("/save/{ds_id}", response_model=None, summary=f"{PLACEHOLDER_PREFIX}tr_save")
|
||||
async def save_relation(session: SessionDep, relation: List[dict],
|
||||
ds_id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")):
|
||||
ds = session.get(CoreDatasource, ds_id)
|
||||
@@ -23,8 +23,8 @@ async def save_relation(session: SessionDep, relation: List[dict],
|
||||
return True
|
||||
|
||||
|
||||
@router.post("/get/{ds_id}", response_model=List[dict], summary=f"{PLACEHOLDER_PREFIX}tr_get")
|
||||
async def save_relation(session: SessionDep, ds_id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")):
|
||||
@router.post("/get/{ds_id}", response_model=List, summary=f"{PLACEHOLDER_PREFIX}tr_get")
|
||||
async def get_relation(session: SessionDep, ds_id: int = Path(..., description=f"{PLACEHOLDER_PREFIX}ds_id")):
|
||||
ds = session.get(CoreDatasource, ds_id)
|
||||
if ds:
|
||||
return ds.table_relation if ds.table_relation else []
|
||||
|
||||
Reference in New Issue
Block a user