mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
parent
720313124c
commit
6b1147d065
@ -1,6 +1,8 @@
|
|||||||
package moe.fuqiuluo.qqinterface.servlet.transfile
|
package moe.fuqiuluo.qqinterface.servlet.transfile
|
||||||
|
|
||||||
import kotlinx.atomicfu.atomic
|
import kotlinx.atomicfu.atomic
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.protobuf.ProtoNumber
|
import kotlinx.serialization.protobuf.ProtoNumber
|
||||||
import moe.fuqiuluo.qqinterface.servlet.BaseSvc
|
import moe.fuqiuluo.qqinterface.servlet.BaseSvc
|
||||||
import moe.fuqiuluo.qqinterface.servlet.TicketSvc
|
import moe.fuqiuluo.qqinterface.servlet.TicketSvc
|
||||||
@ -214,11 +216,12 @@ internal object NtV2RichMediaSvc: BaseSvc() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
data class TryUpPicData(
|
data class TryUpPicData(
|
||||||
val uKey: ByteArray,
|
@SerialName("ukey") val uKey: ByteArray,
|
||||||
val exist: Boolean,
|
@SerialName("exist") val exist: Boolean,
|
||||||
val fileId: ULong,
|
@SerialName("file_id") val fileId: ULong,
|
||||||
var upIp: ArrayList<Long>? = null,
|
@SerialName("up_ip") var upIp: ArrayList<Long>? = null,
|
||||||
var upPort: ArrayList<Int>? = null,
|
@SerialName("up_port") var upPort: ArrayList<Int>? = null,
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -104,7 +104,7 @@ internal object RichProtoSvc: BaseSvc() {
|
|||||||
|
|
||||||
val domain = if (!result.download_file_rsp.str_download_dns.has())
|
val domain = if (!result.download_file_rsp.str_download_dns.has())
|
||||||
("https://" + result.download_file_rsp.str_download_ip.get())
|
("https://" + result.download_file_rsp.str_download_ip.get())
|
||||||
else ("http://" + result.download_file_rsp.str_download_dns.get())
|
else ("http://" + result.download_file_rsp.str_download_dns.get().toByteArray().decodeToString())
|
||||||
val downloadUrl = result.download_file_rsp.bytes_download_url.get().toByteArray().toHexString()
|
val downloadUrl = result.download_file_rsp.bytes_download_url.get().toByteArray().toHexString()
|
||||||
val appId = MobileQQ.getMobileQQ().appId
|
val appId = MobileQQ.getMobileQQ().appId
|
||||||
val version = PlatformUtils.getQQVersion(MobileQQ.getContext())
|
val version = PlatformUtils.getQQVersion(MobileQQ.getContext())
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package moe.fuqiuluo.shamrock.remote.action.handlers
|
||||||
|
|
||||||
|
import moe.fuqiuluo.qqinterface.servlet.transfile.NtV2RichMediaSvc
|
||||||
|
import moe.fuqiuluo.shamrock.remote.action.ActionSession
|
||||||
|
import moe.fuqiuluo.shamrock.remote.action.IActionHandler
|
||||||
|
import moe.fuqiuluo.symbols.OneBotHandler
|
||||||
|
|
||||||
|
@OneBotHandler("request_upload_group_image")
|
||||||
|
internal object RequestUploadGroupImage: IActionHandler() {
|
||||||
|
override suspend fun internalHandle(session: ActionSession): String {
|
||||||
|
val md5 = session.getString("md5").uppercase()
|
||||||
|
val fileSize = session.getLong("file_size")
|
||||||
|
val width = session.getInt("width")
|
||||||
|
val height = session.getInt("height")
|
||||||
|
val groupId = session.getString("group_id")
|
||||||
|
NtV2RichMediaSvc.requestUploadGroupPic(
|
||||||
|
groupId.toULong(),
|
||||||
|
md5,
|
||||||
|
fileSize.toULong(),
|
||||||
|
width.toUInt(),
|
||||||
|
height.toUInt()
|
||||||
|
).onSuccess {
|
||||||
|
return ok(it, session.echo)
|
||||||
|
}.onFailure {
|
||||||
|
return error(it.message ?: it.toString(), session.echo)
|
||||||
|
}
|
||||||
|
return logic("request_upload_group_image failed", session.echo)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user