package com.fdkankan.platform.user.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fdkankan.common.util.DateUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class ResponseCameraSpace implements Serializable, Comparable<ResponseCameraSpace> {

    private Long id;

    private String childName;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date spaceEndTime;

    private int deadlineDays;

    private String content;

    private double usedSpace;

    private String usedSpaceStr;

    private double totalSpace;

    private String totalSpaceStr;

    private String spaceEndStr;

    private Long space;

    private String spaceStr;

    private String snCode;

    @Override
    public int compareTo(ResponseCameraSpace o) {
        if (o.getSpaceEndTime() != null) {
            if (DateUtil.after(this.getSpaceEndTime(), o.getSpaceEndTime())) {
                return 1;
            } else if (DateUtil.after(o.getSpaceEndTime(), this.getSpaceEndTime())) {
                return -1;
            }
        }
        return 0;
    }
}
