package cn.org.bjca.trust.push.message.bean

import cn.org.bjca.trust.push.common.LogHelper
import cn.org.bjca.trust.push.enums.MsgType
import cn.org.bjca.trust.push.message.msg.Message
import cn.org.bjca.trust.push.message.msg.SendMessage
import org.json.JSONException
import org.json.JSONObject

class UnknownMessage : Message() {
    var unkonown: String? = null

    init {
        this.msgType = MsgType.UNKNOWN
    }

    override fun parse(type: MsgType, sendMessage: SendMessage) {
        super.parse(type, sendMessage)
        this.unkonown = sendMessage.message
    }

    override fun createContentJsonStr(): String {

        val json = JSONObject()
        try {
            json.put("unkonown", this.unkonown)
        } catch (e: JSONException) {
            LogHelper.e("消息组装失败", e)
        }
        return json.toString()
    }
}