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

class OtherMessage : Message() {
    var msg: String? = null

    init {
        this.msgType = MsgType.Other
    }

    override fun parse(type: MsgType, sendMessage: SendMessage) {
        super.parse(type, sendMessage)
        try {
            sendMessage.message?.let {
                this.msg = it
            }
        } catch (e: Exception) {
            LogHelper.e("消息组装失败", e)
        }
    }

    override fun createContentJsonStr(): String {
        return this.msg ?: ""
    }
}