CustomAttachChatTipMsg.java 1.01 KB
Newer Older
konghaorui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

/**
 * 自定义提醒消息(短时间内多次私聊,给予提示)本地消息
 * Created by harvie on 2017/1/10.
 */

public class CustomAttachChatTipMsg extends CustomAttachment {
    private static final String KEY_TITLE="from_content";
    private String from_content = "";//提醒内容
    public CustomAttachChatTipMsg() {
        super(0);
    }

    public CustomAttachChatTipMsg(String from_content) {
        super(0);
        this.from_content = from_content;
    }

    @Override
    protected void parseData(JSONObject data) {
        this.from_content=data.getString(KEY_TITLE);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data=new JSONObject();
        data.put(KEY_TITLE,from_content);
        return data;
    }

    public String getFrom_content() {
        return from_content;
    }

    public void setFrom_content(String from_content) {
        this.from_content = from_content;
    }
}