mirror of
https://github.com/InvertGeek/MixFile.git
synced 2026-06-20 12:32:22 +08:00
1
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user