feat(device): 新增远程拍照功能

- 新增设备端与家属端远程拍照接口
- 新增截图实体字段(原始文件名、MIME类型、扩展名)
- 补充截图上传信息记录
- 提取设备操作指令常量
This commit is contained in:
TongTongStudio
2026-08-21 17:12:41 +08:00
parent 32921274a3
commit 9bc37286b7
10 changed files with 388 additions and 11 deletions

View File

@@ -143,6 +143,24 @@ public class ClientDeviceOpsController {
}
}
@Operation(summary = "远程拍照(家属端)")
@PreAuthorize("isAuthenticated()")
@PostMapping("/take_photo")
public Result<?> takePhoto(
@Parameter(description = "设备序列号") @RequestParam("sn") String sn
) {
try {
checkBound(sn);
boolean result = deviceService.takePhoto(sn);
return Result.judge(result);
} catch (BusinessException be) {
return Result.failed(be.getMessage());
} catch (Exception e) {
log.error("remoteCamera error, sn: {}", sn, e);
return Result.failed("设备截图失败: " + e.getMessage());
}
}
@Operation(summary = "设备重启(家属端)")
@PreAuthorize("isAuthenticated()")
@PostMapping("/reboot")