This commit is contained in:
Evan You
2025-04-28 18:45:46 +08:00
parent 34856a21ce
commit e951ab6872
3 changed files with 11 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import com.donut.mixfile.server.core.utils.compressGzip
import io.ktor.http.ContentType
import io.ktor.http.defaultForFilePath
data class FileDataLog(
val shareInfoData: String,
val name: String,

View File

@@ -20,6 +20,7 @@ import io.ktor.http.Url
import io.ktor.http.contentLength
import io.ktor.utils.io.discard
data class MixShareInfo(
@JSONField(name = "f") val fileName: String,
@JSONField(name = "s") val fileSize: Long,
@@ -133,7 +134,7 @@ data class MixShareInfo(
return false
}
fun contentType(): String = fileName.parseFileMimeType().toString()
fun contentType() = fileName.parseFileMimeType()
suspend fun fetchMixFile(client: HttpClient): MixFile {
val decryptedBytes = fetchFile(url, client = client)

View File

@@ -1,5 +1,11 @@
package com.donut.mixfile
import com.alibaba.fastjson2.JSONReader
import com.alibaba.fastjson2.JSONWriter
import com.alibaba.fastjson2.annotation.JSONType
import com.alibaba.fastjson2.to
import com.alibaba.fastjson2.toJSONString
import com.donut.mixfile.server.core.objects.FileDataLog
import org.junit.Test
//appScope.launch(Dispatchers.IO) {
@@ -24,9 +30,10 @@ import org.junit.Test
class ExampleUnitTest {
@Test
fun main() {
println()
}