2024-08-21 14:12:15 +08:00
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'package:star_lock/main/lockDetail/videoLog/videoLog/videoLog_entity.dart';
|
2024-04-26 14:48:26 +08:00
|
|
|
import 'package:star_lock/network/api_repository.dart';
|
2023-11-18 10:38:13 +08:00
|
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
2024-08-21 14:12:15 +08:00
|
|
|
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
2023-11-18 10:38:13 +08:00
|
|
|
import 'editVideoLog_state.dart';
|
|
|
|
|
|
2024-04-26 14:48:26 +08:00
|
|
|
class EditVideoLogLogic extends BaseGetXController {
|
2023-11-18 10:38:13 +08:00
|
|
|
EditVideoLogState state = EditVideoLogState();
|
|
|
|
|
|
2024-08-21 14:12:15 +08:00
|
|
|
Future<void> deleteLockCloudStorageList() async {
|
|
|
|
|
final VersionUndateEntity entity = await ApiRepository.to.deleteLockCloudStorageList(
|
2024-04-26 14:48:26 +08:00
|
|
|
recordIds: state.selectVideoLogList.value.map((e) => e.recordId).toList(),
|
|
|
|
|
);
|
|
|
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
|
|
|
state.selectVideoLogList.value.clear();
|
2024-08-21 14:12:15 +08:00
|
|
|
showToast('删除成功'.tr);
|
2024-04-26 14:48:26 +08:00
|
|
|
getLockCloudStorageList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-21 14:12:15 +08:00
|
|
|
Future<void> getLockCloudStorageList() async {
|
|
|
|
|
final VideoLogEntity entity = await ApiRepository.to.getLockCloudStorageList(
|
2024-04-26 14:48:26 +08:00
|
|
|
lockId: state.getLockId.value,
|
|
|
|
|
);
|
|
|
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
|
|
|
state.videoLogList.value = entity.data!;
|
|
|
|
|
state.videoLogList.refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|