-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
DB/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/db/models/ContainerDB.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Infomaniak SwissTransfer - Multiplatform | ||
* Copyright (C) 2024 Infomaniak Network SA | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.infomaniak.multiplatform_swisstransfer.db.models | ||
|
||
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.Container | ||
import io.realm.kotlin.ext.realmListOf | ||
import io.realm.kotlin.types.RealmList | ||
import io.realm.kotlin.types.RealmObject | ||
import io.realm.kotlin.types.annotations.PrimaryKey | ||
|
||
class ContainerDB : Container<RealmList<FileDB>>, RealmObject { | ||
@PrimaryKey | ||
override var uuid: String = "" | ||
override var duration: Long = 0 | ||
override var createdDateTimestamp: Long = 0 | ||
override var expiredDateTimestamp: Long = 0 | ||
override var numberOfFile: Long = 0 | ||
override var message: String? = "" | ||
override var needPassword: Long = 0 // TODO: Boolean ? | ||
override var lang: String = "" | ||
override var sizeUploaded: Long = 0 | ||
override var deletedDateTimestamp: Long? = null | ||
override var swiftVersion: Long = 0 | ||
override var downloadLimit: Long = 0 | ||
override var source: String = "" | ||
|
||
// @SerialName("WSUser") TODO: What's it ? | ||
//val wsUser: JsonElement? | ||
|
||
override var files: RealmList<FileDB> = realmListOf() | ||
} |
39 changes: 39 additions & 0 deletions
39
DB/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/db/models/FileDB.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Infomaniak SwissTransfer - Multiplatform | ||
* Copyright (C) 2024 Infomaniak Network SA | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.infomaniak.multiplatform_swisstransfer.db.models | ||
|
||
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.File | ||
import io.realm.kotlin.types.RealmObject | ||
import io.realm.kotlin.types.annotations.PrimaryKey | ||
|
||
class FileDB : File, RealmObject { | ||
@PrimaryKey | ||
override var containerUUID: String = "" | ||
override var uuid: String = "" | ||
override var fileName: String = "" | ||
override var fileSizeInBytes: Long = 0 | ||
override var downloadCounter: Long = 0 | ||
override var createdDateTimestamp: Long = 0 | ||
override var expiredDateTimestamp: Long = 0 | ||
override var eVirus: String = "" | ||
override var deletedDate: String? = null | ||
override var mimeType: String = "" | ||
override var receivedSizeInBytes: Long = 0 | ||
override var path: String? = "" | ||
} |
36 changes: 36 additions & 0 deletions
36
DB/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/db/models/TransferDB.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Infomaniak SwissTransfer - Multiplatform | ||
* Copyright (C) 2024 Infomaniak Network SA | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.infomaniak.multiplatform_swisstransfer.db.models | ||
|
||
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.Transfer | ||
import io.realm.kotlin.types.RealmObject | ||
import io.realm.kotlin.types.annotations.PrimaryKey | ||
|
||
class TransferDB : Transfer<ContainerDB>, RealmObject { | ||
@PrimaryKey | ||
override var linkUUID: String = "" | ||
override var containerUUID: String = "" | ||
override var downloadCounterCredit: Long = 0 | ||
override var createdDateTimestamp: Long = 0 | ||
override var expiredDateTimestamp: Long = 0 | ||
override var isDownloadOnetime: Long = 0 // TODO: Boolean ? | ||
override var isMailSent: Boolean = false | ||
override var downloadHost: String = "" | ||
override var container: ContainerDB = ContainerDB() | ||
} |
25 changes: 25 additions & 0 deletions
25
...onMain/kotlin/com/infomaniak/multiplatform_swisstransfer/db/models/setting/AppSettings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Infomaniak SwissTransfer - Multiplatform | ||
* Copyright (C) 2024 Infomaniak Network SA | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.infomaniak.multiplatform_swisstransfer.db.models.setting | ||
|
||
import io.realm.kotlin.types.RealmObject | ||
|
||
class AppSettings : RealmObject { | ||
//TODO: implement here | ||
} |
29 changes: 29 additions & 0 deletions
29
...monMain/kotlin/com/infomaniak/multiplatform_swisstransfer/db/models/upload/UploadTasks.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Infomaniak SwissTransfer - Multiplatform | ||
* Copyright (C) 2024 Infomaniak Network SA | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.infomaniak.multiplatform_swisstransfer.db.models.upload | ||
|
||
import io.realm.kotlin.types.RealmObject | ||
|
||
/** | ||
* Class representing files to be uploaded | ||
*/ | ||
class UploadTasks : RealmObject { | ||
var userId: Long = 0 | ||
//TODO: implement | ||
} |