-
Notifications
You must be signed in to change notification settings - Fork 2
/
Place.kt
52 lines (46 loc) Β· 1.21 KB
/
Place.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package place.pic.data.entity
import java.util.*
/**
* Created By Malibin
* on 7μ 03, 2020
*/
data class Place(
val id: Int,
val name: String,
val imageUrl: String,
val subways: List<Subway>,
val keywordTags: List<KeywordTag>,
val uploadDate: Date,
val uploaderName: String,
val uploaderProfileUrl: String,
//dahye
val likeCnt: Int,
val commentCnt: Int
) {
companion object {
fun empty() = Place(
id = -1,
name = "",
imageUrl = "",
subways = emptyList(),
keywordTags = emptyList(),
uploadDate = Date(),
uploaderName = "",
uploaderProfileUrl = "",
likeCnt = 0,
commentCnt = 0
)
}
enum class Type(val position: Int, val value: String) {
ALL(0, "μ 체"),
RESTAURANT(1, "λ§μ§"),
ALCOHOL(2, "μ μ§"),
CAFE(3, "μΉ΄ν"),
STUDY(4, "μ€ν°λ"),
ETC(5, "κΈ°ν");
companion object {
fun findByName(name: String): Type = values().first { it.value == name }
fun findByPosition(position: Int): Type = values().first { it.position == position }
}
}
}