temporal progress

This commit is contained in:
InsanusMokrassar 2022-01-19 17:22:04 +06:00
parent a651d8560e
commit d1fa0242fa
10 changed files with 32 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import dev.inmo.micro_utils.pagination.*
import dev.inmo.micro_utils.repos.UpdatedValuePair
import dev.inmo.postssystem.features.content.binary.common.DefaultBinaryContent
import dev.inmo.postssystem.features.content.common.*
import dev.inmo.postssystem.features.content.server.ServerContentStorage
import dev.inmo.postssystem.features.content.server.storage.ServerContentStorage
import dev.inmo.postssystem.features.files.common.*
import dev.inmo.postssystem.features.files.common.storage.FilesStorage
import kotlinx.coroutines.flow.Flow

View File

@ -0,0 +1,22 @@
package dev.inmo.postssystem.features.content.server
import com.benasher44.uuid.uuid4
import dev.inmo.micro_utils.common.FileName
import io.ktor.http.content.PartData
import java.io.File
suspend fun PartData.loadContent() {
when (this) {
is PartData.FormItem -> TODO()
is PartData.FileItem -> {
val fileName = FileName(originalFileName ?: return null)
val downloadTo = File.createTempFile(
uuid4().toString(),
fileName.extension
)
headers["data"]
return
}
is PartData.BinaryItem -> return null/* Currently impossible state */
}
}

View File

@ -3,6 +3,7 @@ package dev.inmo.postssystem.features.content.server
import dev.inmo.micro_utils.pagination.*
import dev.inmo.micro_utils.repos.UpdatedValuePair
import dev.inmo.postssystem.features.content.common.*
import dev.inmo.postssystem.features.content.server.storage.ServerContentStorage
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.Flow

View File

@ -2,6 +2,8 @@ package dev.inmo.postssystem.features.content.server
import dev.inmo.micro_utils.repos.UpdatedValuePair
import dev.inmo.postssystem.features.content.common.*
import dev.inmo.postssystem.features.content.server.storage.ServerContentStorage
import dev.inmo.postssystem.features.content.server.storage.ServerReadContentStorage
import kotlinx.coroutines.flow.Flow
import kotlin.reflect.KClass

View File

@ -1,4 +1,4 @@
package dev.inmo.postssystem.features.content.server
package dev.inmo.postssystem.features.content.server.storage
import dev.inmo.micro_utils.repos.CRUDRepo
import dev.inmo.postssystem.features.content.common.*

View File

@ -1,4 +1,4 @@
package dev.inmo.postssystem.features.content.server
package dev.inmo.postssystem.features.content.server.storage
import dev.inmo.micro_utils.repos.ReadCRUDRepo
import dev.inmo.postssystem.features.content.common.ContentId

View File

@ -1,4 +1,4 @@
package dev.inmo.postssystem.features.content.server
package dev.inmo.postssystem.features.content.server.storage
import dev.inmo.micro_utils.repos.WriteCRUDRepo
import dev.inmo.postssystem.features.content.common.*

View File

@ -5,7 +5,7 @@ import dev.inmo.micro_utils.repos.exposed.AbstractExposedCRUDRepo
import dev.inmo.micro_utils.repos.exposed.initTable
import dev.inmo.postssystem.features.content.common.ContentId
import dev.inmo.postssystem.features.content.common.RegisteredContent
import dev.inmo.postssystem.features.content.server.ServerContentStorage
import dev.inmo.postssystem.features.content.server.storage.ServerContentStorage
import dev.inmo.postssystem.features.content.text.common.TextContent
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.statements.InsertStatement

View File

@ -1,7 +1,7 @@
package dev.inmo.postssystem.features.publication.server
import dev.inmo.micro_utils.coroutines.asyncSafelyWithoutExceptions
import dev.inmo.postssystem.features.content.server.ServerReadContentStorage
import dev.inmo.postssystem.features.content.server.storage.ServerReadContentStorage
import dev.inmo.postssystem.features.posts.common.PostId
import dev.inmo.postssystem.features.posts.server.ServerReadPostsStorage
import kotlinx.coroutines.*

View File

@ -28,7 +28,7 @@ import dev.inmo.postssystem.features.common.common.*
import dev.inmo.postssystem.features.content.binary.common.BinaryContentSerializerModuleConfigurator
import dev.inmo.postssystem.features.content.binary.server.BinaryServerContentStorage
import dev.inmo.postssystem.features.content.common.*
import dev.inmo.postssystem.features.content.server.ServerContentStorage
import dev.inmo.postssystem.features.content.server.storage.ServerContentStorage
import dev.inmo.postssystem.features.content.server.ServerContentStorageAggregator
import dev.inmo.postssystem.features.content.text.common.TextContentSerializerModuleConfigurator
import dev.inmo.postssystem.features.content.text.server.TextServerContentStorage