-
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
7 changed files
with
44 additions
and
18 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -53,4 +53,6 @@ dependencies { | |
|
||
implementation libs.realm.sync | ||
implementation libs.coroutines.core | ||
|
||
implementation(libs.timber) | ||
} |
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
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
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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
package com.example.util.model | ||
|
||
import android.annotation.SuppressLint | ||
import com.example.util.toRealmInstant | ||
import io.realm.kotlin.ext.realmListOf | ||
import io.realm.kotlin.types.ObjectId | ||
import io.realm.kotlin.types.RealmInstant | ||
import io.realm.kotlin.types.RealmList | ||
import io.realm.kotlin.types.RealmObject | ||
import io.realm.kotlin.types.annotations.PrimaryKey | ||
import org.mongodb.kbson.ObjectId | ||
import java.time.Instant | ||
|
||
// Mongo DB model schema(model class) | ||
// not support enum class type | ||
open class Diary : RealmObject { | ||
@PrimaryKey | ||
var _id: ObjectId = ObjectId.create() // automatically generated | ||
var _id: ObjectId = ObjectId.invoke() // automatically generated | ||
var ownerId: String = "" | ||
var mood: String = Mood.Neutral.name | ||
var title: String = "" | ||
var description: String = "" | ||
var images: RealmList<String> = realmListOf() | ||
@SuppressLint("NewApi") | ||
var date: RealmInstant = Instant.now().toRealmInstant() // defaultValue | ||
} |
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
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
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