You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
505 B

from fastapi import APIRouter, Depends, status
from internal.models import *
from dependencies import get_current_active_user, execute_query
router = APIRouter(
prefix="/types",
tags=["分类管理"]
)
@router.get("/list")
async def read_type_all():
select_query = "SELECT id,typename,descr FROM types;"
type_all = execute_query(select_query, fetchall=True)
return {
"status": status.HTTP_200_OK,
"message": "type search successfully!",
"data": type_all
}