feat: 动态菜单
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from fastapi import Query
|
||||
|
||||
from dbhelper.menu import del_menu, get_menus, insert_menu
|
||||
from dbhelper.menu import del_menu, get_menus, insert_menu, put_menu
|
||||
from schemas import ListAll, MenuIn, MenuRead, Response
|
||||
|
||||
|
||||
@@ -21,3 +21,11 @@ async def menu_del(pk: int) -> Response:
|
||||
if await del_menu(pk) == 0:
|
||||
return Response(code=400, msg="菜单不存在")
|
||||
return Response()
|
||||
|
||||
|
||||
async def menu_put(pk: int, data: MenuIn) -> Response:
|
||||
"""更新菜单"""
|
||||
if await put_menu(pk, data) == 0:
|
||||
return Response(code=400, msg="菜单不存在")
|
||||
return Response()
|
||||
|
||||
|
Reference in New Issue
Block a user