From 068de99531b3c5c28314be0a17c6d7979137ac72 Mon Sep 17 00:00:00 2001 From: ryoii Date: Fri, 21 Feb 2020 22:51:36 +0800 Subject: [PATCH] http api prepare for recall with a dto --- .../net/mamoe/mirai/api/http/route/MessageRouteModule.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/MessageRouteModule.kt b/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/MessageRouteModule.kt index be9be7b03..8c0c69472 100644 --- a/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/MessageRouteModule.kt +++ b/mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/MessageRouteModule.kt @@ -18,12 +18,12 @@ import io.ktor.response.respondText import io.ktor.routing.post import io.ktor.routing.routing import kotlinx.serialization.Serializable +import kotlinx.serialization.Transient import net.mamoe.mirai.api.http.AuthedSession import net.mamoe.mirai.api.http.SessionManager import net.mamoe.mirai.api.http.data.* import net.mamoe.mirai.api.http.data.common.MessageChainDTO import net.mamoe.mirai.api.http.data.common.VerifyDTO -import net.mamoe.mirai.api.http.data.common.toDTO import net.mamoe.mirai.api.http.data.common.toMessageChain import net.mamoe.mirai.api.http.util.toJson import net.mamoe.mirai.contact.toList @@ -119,3 +119,8 @@ private data class SendImageDTO( val urls: List ) : VerifyDTO() +@Serializable +private class SendRetDTO( + @Transient val stateCode: StateCode = StateCode.Success, + val messageId: Long +) : StateCode(stateCode.code, stateCode.msg)