feat: 优化发布清单和安装结构自动识别

This commit is contained in:
2026-07-15 06:33:33 +00:00
parent 0548692db0
commit 4df439b5ce
28 changed files with 1702 additions and 198 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
from fastapi import APIRouter, Depends, HTTPException
from app.core.security import admin_auth
from app.core.security import require_permission
from app.repositories import device_repository
from app.schemas.device import DeviceSetDisabledRequest
@@ -9,12 +9,12 @@ router = APIRouter(tags=["admin-device"])
@router.get("/admin/device/list")
def admin_device_list(app_id: str = "", auth=Depends(admin_auth)):
def admin_device_list(app_id: str = "", auth=Depends(require_permission("device:view"))):
return {"list": device_repository.list_devices(app_id)}
@router.post("/admin/device/set-disabled")
def admin_device_set_disabled(body: DeviceSetDisabledRequest, auth=Depends(admin_auth)):
def admin_device_set_disabled(body: DeviceSetDisabledRequest, auth=Depends(require_permission("device:manage"))):
device_id = body.device_id.strip()
disabled = bool(body.disabled)
reason = body.reason.strip()