1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import {FolderType, Delete} from './EnumData' 17 18/** 19 * 文件夹类 20 */ 21export default class FolderData { 22 id: number // 主键 23 name: string // 名称 24 uuid: string // 唯一标识 25 color: string // 图标颜色 26 folder_type: FolderType // 类型 27 is_deleted: Delete // 是否被删除 28 created_time: number // 创建时间 29 modified_time: number // 修改时间 30 31 constructor(id: number, name: string, uuid: string, color: string, folder_type: FolderType, 32 is_deleted: Delete, created_time: number, modified_time: number) { 33 this.id = id 34 this.name = name 35 this.uuid = uuid 36 this.color = color 37 this.folder_type = folder_type 38 this.is_deleted = is_deleted 39 this.created_time = created_time 40 this.modified_time = modified_time 41 } 42 43 /** 44 * 转化为folder_table表的valueBucket 45 */ 46 toFolderObject(): any{ 47 return { 48 "name": this.name, 49 "uuid": this.uuid, 50 "color": this.color, 51 "folder_type": this.folder_type, 52 "is_deleted": this.is_deleted, 53 "created_time": this.created_time, 54 "modified_time": this.modified_time 55 } 56 } 57}