CustomAttachmentReceivedSuccess.java 1.82 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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

/**
 * 后台推送到收款状态,比如超时未支付或者已经支付到拓展
 * Created by harvie on 2017/1/13.
 */

public class CustomAttachmentReceivedSuccess extends CustomAttachment {
    private static final String KEY_FROM_CONTENT = "from_content";
    private static final String KEY_FROM_UID = "from_uid";
    private static final String KEY_TO_CONTENT = "to_content";
    private static final String KEY_TO_UID = "touid";
    private static final String KEY_POCKET_ID="orderid";

    private String from_content ="";
    private String from_uid = "";
    private String to_content = "";
    private String touid = "";
    private String orderid = "";

    public CustomAttachmentReceivedSuccess() {
        super(CustomAttachmentType.RECEIVEDMONEY_STATUS);
    }

    @Override
    protected void parseData(JSONObject data) {
        from_content = data.getString(KEY_FROM_CONTENT);
        from_uid = data.getString(KEY_FROM_UID);
        to_content = data.getString(KEY_TO_CONTENT);
        touid = data.getString(KEY_TO_UID);
        orderid=data.getString(KEY_POCKET_ID);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        data.put(KEY_FROM_CONTENT, from_content);
        data.put(KEY_FROM_UID, from_uid);
        data.put(KEY_TO_CONTENT, to_content);
        data.put(KEY_TO_UID, touid);
        data.put(KEY_POCKET_ID,orderid);
        return data;
    }

    public String getFrom_content() {
        return from_content;
    }

    public String getFrom_uid() {
        return from_uid;
    }

    public String getTo_content() {
        return to_content;
    }

    public String getTouid() {
        return touid;
    }

    public String getOrderid() {
        return orderid;
    }
}