Skip to content

๐ŸŽ Model

์ตœ์ง€ํ™˜ edited this page Nov 25, 2022 · 8 revisions

Data

  • Moment
data class MomentEntity(
    @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "moment_id") val id: Long = 0L,
    @Embedded val place: PlaceEntity,
    @ColumnInfo(name = "thumbnail_id", index = true) val thumbnailId: Long?,
    @ColumnInfo(name = "content") val content: String,
    @ColumnInfo(name = "date") val date: Long,
)
  • Place
data class PlaceEntity(
    val mainAddress: String,
    val detailAddress: String,
    val latitude: Double,
    val longitude: Double,
)
  • Location
data class LocationEntity(
    val latitude: Double,
    val longitude: Double,
)
  • Picture
data class PictureEntity(
    @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "picture_id") val id: Long = 0L,
    @ColumnInfo(name = "fileName") val fileName: String,
)
  • Location
data class LocationEntity(
    val latitude: Double,
    val longitude: Double,
)
  • Globe
data class GlobeEntity(
    @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "globe_id") val id: Long = 0L,
    @ColumnInfo(name = "name") val name: String,
)

Domain

  • Moment
data class Moment(
    val id: Long,
    val place: Place,
    val pictures: List<Picture>,
    val content: String,
    val globes: List<Globe>,
    val date: Long,
)
  • Place
data class Place(
    val mainAddress: String,
    val detailAddress: String,
    val location: Location
)
  • Location
data class Location(
    val latitude: Double,
    val longitude: Double,
)
  • Picture
data class Picture(
    val bitmap: ByteArray
)
  • Globe
data class Globe(
    val name: String,
)

UI

  • Moment
data class MomentModel(
    val id: Long = 0,
    val place: PlaceModel,
    val pictures: List<PictureModel>,
    val content: String,
    val globes: List<GlobeModel>,
    val date: Long,
): Serializable
  • Place
data class PlaceModel(
    val mainAddress: String,
    val detailAddress: String,
    val location: LocationModel
) : Parcelable
  • Location
data class LocationModel(
    val latitude: Double,
    val longitude: Double,
) : Parcelable
  • Picture
data class PictureModel(
    val bitmap: Bitmap
)
  • Globe
data class GlobeModel(
    val name: String,
)

image

๐Ÿ—ฃ๏ธ ๋ฐ๋ชจ

โš ๏ธ ์ด์Šˆ ๊ณต์œ 

๐Ÿ‘Ÿ ์ฃผ๊ฐ„ ์Šคํ”„๋ฆฐํŠธ

โ˜€๏ธ ๋ฐ์ผ๋ฆฌ ์Šคํฌ๋Ÿผ

๐Ÿ“‚ week2
๐Ÿ“‚ week3
๐Ÿ“‚ week4
๐Ÿ“‚ week5
๐Ÿ“‚ week6
Clone this wiki locally