38 lines
1.1 KiB
Dart
Executable File
38 lines
1.1 KiB
Dart
Executable File
import 'dart:typed_data';
|
|
|
|
import 'package:star_lock/main/lockDetail/videoLog/videoLog/videoLog_entity.dart';
|
|
import 'package:star_lock/network/api_repository.dart';
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
|
|
|
import 'videoLog_state.dart';
|
|
|
|
class VideoLogLogic extends BaseGetXController {
|
|
VideoLogState state = VideoLogState();
|
|
|
|
void getLockCloudStorageList() async {
|
|
var entity = await ApiRepository.to.getLockCloudStorageList(
|
|
lockId: state.getLockId.value,
|
|
);
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
state.videoLogList.value = entity.data!;
|
|
state.videoLogList.value.forEach((element) {
|
|
// 过滤掉 imagesUrl 和 videoUrl 都为 null 或空字符串的项
|
|
element.recordList = element.recordList!
|
|
.where((record) =>
|
|
(record.imagesUrl != null && record.imagesUrl!.isNotEmpty) ||
|
|
(record.videoUrl != null && record.videoUrl!.isNotEmpty))
|
|
.toList();
|
|
});
|
|
|
|
state.videoLogList.refresh();
|
|
}
|
|
}
|
|
|
|
@override
|
|
onReady() {
|
|
super.onReady();
|
|
|
|
getLockCloudStorageList();
|
|
}
|
|
}
|