65 lines
1.6 KiB
Python
65 lines
1.6 KiB
Python
from fastapi import APIRouter
|
|
|
|
from backend.app.schemas.common import success_payload
|
|
|
|
router = APIRouter(prefix="/api/system", tags=["system"])
|
|
|
|
|
|
@router.get("/users")
|
|
def list_users() -> dict:
|
|
return success_payload(
|
|
{
|
|
"total": 2,
|
|
"page_no": 1,
|
|
"page_size": 20,
|
|
"list": [
|
|
{
|
|
"user_id": 1,
|
|
"username": "sales01",
|
|
"real_name": "张三",
|
|
"mobile": "13800000000",
|
|
"role_id": 2,
|
|
"role_name": "业务员",
|
|
"role_code": "salesman",
|
|
"status": 1,
|
|
"created_at": "2026-05-14 10:00:00",
|
|
}
|
|
],
|
|
}
|
|
)
|
|
|
|
|
|
@router.get("/roles")
|
|
def list_roles() -> dict:
|
|
return success_payload(
|
|
{
|
|
"total": 2,
|
|
"page_no": 1,
|
|
"page_size": 20,
|
|
"list": [
|
|
{"role_id": 1, "role_name": "管理员", "role_code": "admin", "status": 1},
|
|
{"role_id": 2, "role_name": "业务员", "role_code": "salesman", "status": 1},
|
|
],
|
|
}
|
|
)
|
|
|
|
|
|
@router.get("/menus")
|
|
def list_menus() -> dict:
|
|
return success_payload(
|
|
[
|
|
{
|
|
"menu_id": 1,
|
|
"parent_id": 0,
|
|
"menu_name": "订单管理",
|
|
"menu_path": "/orders",
|
|
"menu_type": "page",
|
|
"permission_code": "order:list",
|
|
"icon": "order",
|
|
"sort_no": 10,
|
|
"status": 1,
|
|
"children": [],
|
|
}
|
|
]
|
|
)
|