/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { SysDefFolder, SysDefFolderUuid, FolderType, NoteType, Favorite, Top, Delete } from './EnumData';
import relationalStore from '@ohos.data.relationalStore';
interface DbInfoType {
db_name: DbNameType;
db_verison: number;
}
interface DbNameType {
name: string;
securityLevel: relationalStore.SecurityLevel;
}
class SysDefData {
/**
* db info
*/
public dbInfo: DbInfoType = {
db_name: {
name: "note.db", // 数据库名称
securityLevel: relationalStore.SecurityLevel.S1
},
db_verison: 1 // 数据库版本
};
/**
* system defined folder
*/
public sys_def_allNotes: relationalStore.ValuesBucket = {
"id": 1,
"name": SysDefFolder.AllNotes,
"uuid": SysDefFolderUuid.AllNotes,
"color": "#ffffff",
"folder_type": FolderType.SysDef,
"is_deleted": Delete.No,
"created_time": 1641863695000,
"modified_time": 1641863695000
};
public sys_def_unClassified: relationalStore.ValuesBucket = {
"id": 2,
"name": SysDefFolder.UnClassified,
"uuid": SysDefFolderUuid.UnClassified,
"color": "#ffffff",
"folder_type": FolderType.SysDef,
"is_deleted": Delete.No,
"created_time": 1641860095000,
"modified_time": 1641860095000
};
public sys_def_myFavorites: relationalStore.ValuesBucket = {
"id": 3,
"name": SysDefFolder.MyFavorites,
"uuid": SysDefFolderUuid.MyFavorites,
"color": "#ffffff",
"folder_type": FolderType.FeatureDef,
"is_deleted": Delete.No,
"created_time": 1641856088000,
"modified_time": 1641856088000
};
public sys_def_recentDeletes: relationalStore.ValuesBucket = {
"id": 4,
"name": SysDefFolder.RecentDeletes,
"uuid": SysDefFolderUuid.RecentDeletes,
"color": "#ffffff",
"folder_type": FolderType.FeatureDef,
"is_deleted": Delete.No,
"created_time": 1641848898000,
"modified_time": 1641848898000
};
public sys_def_personal: relationalStore.ValuesBucket = {
"id": 5,
"name": "个人",
"uuid": SysDefFolderUuid.Personal,
"color": "#41ba41",
"folder_type": FolderType.CusDef,
"is_deleted": Delete.No,
"created_time": 1641677288000,
"modified_time": 1641677288000
};
public sys_def_life: relationalStore.ValuesBucket = {
"id": 6,
"name": "生活",
"uuid": SysDefFolderUuid.Life,
"color": "#00aaee",
"folder_type": FolderType.CusDef,
"is_deleted": Delete.No,
"created_time": 1641676108000,
"modified_time": 1641676108000
};
public sys_def_work: relationalStore.ValuesBucket = {
"id": 7,
"name": "工作",
"uuid": SysDefFolderUuid.Work,
"color": "#f86d05",
"folder_type": FolderType.CusDef,
"is_deleted": Delete.No,
"created_time": 1641636508000,
"modified_time": 1641636508000
};
/**
* system defined note
*/
public sys_def_note1: relationalStore.ValuesBucket = {
"id": 1,
"title": "数学公式",
"uuid": "note1_uuid",
"folder_uuid": SysDefFolderUuid.UnClassified,
"content_text": '