change HttpMessage location

This commit is contained in:
2022-08-23 16:34:16 +08:00
parent 58402a6400
commit 5d742df466
8 changed files with 36 additions and 34 deletions

View File

@@ -0,0 +1,32 @@
package com.synebula.gaea.data.message
import com.synebula.gaea.data.serialization.json.IJsonSerializer
class HttpMessage() : DataMessage<Any>() {
var serializer: IJsonSerializer? = null
constructor(data: Any) : this() {
this.data = data
}
constructor(status: Int, message: String) : this() {
this.status = status
this.message = message
}
constructor(status: Int, data: Any, message: String) : this(status, message) {
this.data = data
}
fun load(msg: DataMessage<*>) {
this.status = msg.status
this.message = msg.message
this.data = msg.data
}
override fun toString(): String {
return serializer?.serialize(this) ?: super.toString()
}
}