experimentally add uuid library
This commit is contained in:
parent
5b3b3afe8d
commit
6a4b904b9a
@ -36,6 +36,7 @@ kotlin {
|
|||||||
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlin_serialisation_runtime_version"
|
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$kotlin_serialisation_runtime_version"
|
||||||
|
|
||||||
api "com.soywiz.korlibs.klock:klock:$klockVersion"
|
api "com.soywiz.korlibs.klock:klock:$klockVersion"
|
||||||
|
api "com.benasher44:uuid:$uuidVersion"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jvm8Main {
|
jvm8Main {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package com.insanusmokrassar.postssystem.core.utils
|
package com.insanusmokrassar.postssystem.core.utils
|
||||||
|
|
||||||
|
import com.benasher44.uuid.uuid4
|
||||||
import com.insanusmokrassar.postssystem.core.content.ContentId
|
import com.insanusmokrassar.postssystem.core.content.ContentId
|
||||||
import com.insanusmokrassar.postssystem.core.post.PostId
|
import com.insanusmokrassar.postssystem.core.post.PostId
|
||||||
|
|
||||||
internal expect fun generateId(): String
|
private fun generateId() = uuid4().toString()
|
||||||
|
|
||||||
internal fun generatePostId(): PostId = generateId()
|
internal fun generatePostId(): PostId = generateId()
|
||||||
internal fun generateContentId(): ContentId = generateId()
|
internal fun generateContentId(): ContentId = generateId()
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package com.insanusmokrassar.postssystem.core.utils
|
|
||||||
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
internal actual fun generateId(): String = UUID.randomUUID().toString()
|
|
@ -4,6 +4,7 @@ kotlin_coroutines_version=1.3.1
|
|||||||
kotlin_serialisation_runtime_version=0.13.0
|
kotlin_serialisation_runtime_version=0.13.0
|
||||||
|
|
||||||
klockVersion=1.7.3
|
klockVersion=1.7.3
|
||||||
|
uuidVersion=0.0.5
|
||||||
|
|
||||||
gradle_bintray_plugin_version=1.8.4
|
gradle_bintray_plugin_version=1.8.4
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user