package cn.com.taiji.beidou.ship.status.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;

import java.util.Date;

/**
 * @Author CHEN
 * @Date 2022/11/12 14:47
 */
@Data
public class ShipStatusData {

    private String deviceId;
    private OnlineStatus isOnline;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date onlineChangeTime;
    private String isInport;
    /** 在港状态变更时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date inportChangeTime;


    public enum OnlineStatus {
        ONLINE("1","在线"),
        OFFLINE("2","离线"),
        MARK("3","标记");

        private final String value;
        @JsonValue    //需要在前端展示哪个值就在哪个属性上加上该注解
        private String text;

        public String getValue() {
            return value;
        }

        private OnlineStatus(String value,String text) {
            this.value = value;
            this.text = text;
        }
    }
}
