remove AuthResDTO

This commit is contained in:
ryoii 2020-02-04 20:35:03 +08:00
parent 4ba2b34a81
commit 9b4bacc243
2 changed files with 2 additions and 5 deletions

View File

@ -4,6 +4,3 @@ import kotlinx.serialization.Serializable
@Serializable
data class AuthDTO(val authKey: String) : DTO
@Serializable
data class AuthResDTO(val code: Int, val session: String) : DTO

View File

@ -14,9 +14,9 @@ fun Application.authModule() {
routing {
miraiAuth("/auth") {
if (it.authKey != SessionManager.authKey) {
call.respondDTO(AuthResDTO(1, ""))
call.respondStateCode(StateCode(1, "Auth Key错误"))
} else {
call.respondDTO(AuthResDTO(0, SessionManager.createTempSession().key))
call.respondStateCode(StateCode(0, SessionManager.createTempSession().key))
}
}