package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

public class CustomAttachmentOrderAlreadyDone extends CustomAttachment{

    private String TITLE = "title";//标题
    private String STATUS="status";//状态，1代表已确认，0代表待确认
    private String CONSULTDURATION="consultDuration";//购买时长
    private String SERVICETYPE="serviceType"; //服务方式
    private String ORDERID="orderId";//订单号





    public String title;
    public String status;
    public String consultDuration;
    public String serviceType;
    public String orderId;

    CustomAttachmentOrderAlreadyDone() {
        super(CustomAttachmentType.TYPE_ORDER_ALREADY_DONE);
    }

    @Override
    protected void parseData(JSONObject data) {
        title = data.getString(TITLE);
        status = data.getString(STATUS);
        consultDuration = data.getString(CONSULTDURATION);
        serviceType = data.getString(SERVICETYPE);
        orderId = data.getString(ORDERID);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        data.put(TITLE, title);
        data.put(STATUS, status);
        data.put(CONSULTDURATION, consultDuration);
        data.put(SERVICETYPE, serviceType);
        data.put(ORDERID, orderId);
        return data;
    }
}
