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

10 months ago
11 months ago
10 months ago
  1. from fastapi import APIRouter, Depends, status
  2. from internal.models import *
  3. from dependencies import get_current_active_user, execute_query
  4. router = APIRouter(
  5. prefix="/types",
  6. tags=["分类管理"]
  7. )
  8. @router.get("/list")
  9. async def read_type_all():
  10. select_query = "SELECT id,typename,descr FROM types;"
  11. type_all = execute_query(select_query, fetchall=True)
  12. return {
  13. "status": status.HTTP_200_OK,
  14. "message": "type search successfully!",
  15. "data": type_all
  16. }