summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h')
-rwxr-xr-xlibs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h
new file mode 100755
index 0000000..67c4ae0
--- /dev/null
+++ b/libs/ihealth-sdk/ios/ReactNativeIOSLibrary/Communication_SDK/Headers/IDODataMigrationManager.h
@@ -0,0 +1,79 @@
1//
2// IDODataMigrationManager.h
3// IDOBluetooth
4//
5// Created by 何东阳 on 2018/12/7.
6// Copyright © 2018年 apple. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11@interface IDODataMigrationManager : NSObject
12
13/**
14 * 删除本地数据迁移状态(用于本地数据库表删除数据使用) | Delete local data migration state (used for local database table deletion data)
15 */
16+ (BOOL)deleteDataMigrationState;
17
18/**
19 * 是否需要数据迁移,只有需要迁移才会有下面迁移的启动和回调,新的项目不需要执行数据迁移,注意的问题数据迁移是在异步操作,⚠️在数据量大时比较耗时,尽量在执行完数据迁移再去执行其他工作.
20 * Whether data migration is required, only the migration and the callback of the following migration are required.
21  * New projects do not need to perform data migration, pay attention to the problem data migration is in asynchronous operation,
22  * ⚠️ It is time consuming when the amount of data is large, try to perform other tasks after performing data migration.
23 */
24+ (BOOL)isNeedMigration;
25
26/**
27 * 判断当前是否在迁移数据
28 * Determine if data is currently being migrated.
29 */
30+ (BOOL)isMigrationRun;
31
32/**
33 * 启动数据迁移
34 * Start data migration
35 */
36+ (void)dataMigrationStart;
37
38/**
39 * 数据迁移进度 (0-1)
40 * progress (0-1)
41 */
42+ (void)dataMigrationProgressBlock:(void(^_Nullable)(float progress))callback;
43
44/**
45 * 数据迁移完成 direNames 传入不能删除的目录名字集合,在Documents中其他的目录会在迁移完数据全部删除,
46 * ⚠️如果不传入目录集合,除了sdk新创建的目录不删除之外其他都会删除,所以根据开发需求自行传入目录名字集合
47 * Data migration is completed direNames is passed to the collection of directory names that cannot be deleted. In the other directories in Documents,
48 * all the data will be deleted after the migration.⚠️if you do not pass the directory collection, except for the newly created directory of sdk,
49 * it will be deleted,so you will pass the directory name collection according to the development requirements.
50 */
51+ (void)dataMigrationWithFileNames:(NSArray *_Nullable)names
52 completeBlock:(void(^_Nullable)(BOOL isSuccess))callback;
53
54
55/**
56 * 启动数据库转换json文件 ⚠️ 在数据量大时比较耗时,尽量在执行完数据迁移再去执行其他工作.
57 * 1、若传入json文件路径存在,先把json文件数据同步到数据库中,然后合并的数据库再转成json文件;
58 * 2、若传入json文件路径为空,只把本地数据库转成json文件,并返回json文件压缩路径;
59 * 3、jsonDirePath 是从云端下载的健康json文件目录路径;
60 * start the database to convert the json file ⚠️ it is time consuming when the amount of data is large,try to perform other tasks after performing the data migration.
61 * 1. If the path to the json file exists, synchronize the json file data to the database, and then merge the database into a json file.
62 * 2. If the path to the json file is empty, only convert the local database to a json file and return the path to the json file zip.
63 * 3. jsonDirePath is the path to the healthy json file directory downloaded from the cloud.
64 */
65+ (void)dataToJsonFileStart:(NSString *_Nullable)jsonZipPath;
66
67/**
68 数据转换json文件进度 (0-1) | Data conversion json file progress (0-1)
69 */
70+ (void)dataToJsonFileProgressBlock:(void(^_Nullable)(float progress))callback;
71
72/**
73 数据转换json文件完成
74 zipPath 本地数据库转换json文件压缩路径
75 Data conversion json file completed newDirePath local database conversion json file zip path
76 */
77+ (void)dataToJsonFileCompleteBlock:(void(^_Nullable)(BOOL isSuccess,NSString * _Nullable zipPath))callback;
78
79@end