package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

public class CustomAttachmentConfirmOrder extends CustomAttachment{
    private static final String TITLE="title";//标题
    private static final String STATUS="status";//状态，1代表已确认，0代表待确认
    private static final String BOOKINGTIME="bookingTime";///咨询时间
    private static final String SERVICETYPE="serviceType";//服务方式
    private static final String ORDERID="orderId";//订单号

    public String title;
    public String status;
    public String bookingtime;
    public String servicetype;
    public Long orderid;

    CustomAttachmentConfirmOrder() {
        super(CustomAttachmentType.TYPE_CONFIRM_ORDER);
    }


    @Override
    protected void parseData(JSONObject data) {
        this.title=data.getString(TITLE);
        this.status=data.getString(STATUS);
        this.bookingtime=data.getString(BOOKINGTIME);
        this.servicetype=data.getString(SERVICETYPE);
        this.orderid=data.getLong(ORDERID);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        data.put(TITLE,title);
        data.put(STATUS, status);
        data.put(BOOKINGTIME, bookingtime);
        data.put(SERVICETYPE, servicetype);
        data.put(ORDERID, orderid);
        return data;
    }
}
