CustomAttachConsultCallStatus.java 1.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

/**
 * Created by Wi1ls on 2016/11/28;
 */
public class CustomAttachConsultCallStatus extends CustomAttachment{
    private final String KEY_STATUS="status";
    private final String KEY_CALLER="caller";
    private final String KEY_CALLEE="callee";
    private final String KEY_DURATION="duration";
ydl committed
13
    private final String KEY_IS_CONSULT_ORDER = "isConsultOrder"; //是否是咨询单,true是
14 15 16 17
    private String status;
    private String caller;
    private String callee;
    private String duration;
ydl committed
18
    private String isConsultOrder;
19 20 21 22 23 24 25 26 27 28 29

    public CustomAttachConsultCallStatus() {
        super(CustomAttachmentType.TYPE_CUSTOMER_CONSULT_CALL_STATUS);
    }

    @Override
    protected void parseData(JSONObject data) {
        this.status=data.getString(KEY_STATUS);
        this.caller=data.getString(KEY_CALLER);
        this.callee=data.getString(KEY_CALLEE);
        this.duration=data.getString(KEY_DURATION);
ydl committed
30
        this.isConsultOrder=data.getString(KEY_IS_CONSULT_ORDER);
31 32 33 34 35 36 37 38 39
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        data.put(KEY_STATUS,status);
        data.put(KEY_CALLER, caller);
        data.put(KEY_CALLEE, callee);
        data.put(KEY_DURATION, duration);
ydl committed
40
        data.put(KEY_IS_CONSULT_ORDER, isConsultOrder);
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
        return data;
    }

    public String getStatus() {
        return status;
    }

    public String getCaller() {
        return caller;
    }

    public String getCallee() {
        return callee;
    }

    public String getDuration() {
        return duration;
    }
ydl committed
59 60 61

    public String getIsConsultOrder() {return isConsultOrder;}
}