package com.pwt.netty.message2;

import lombok.Getter;
import lombok.Setter;

public class ChargerStateInfo extends BaseData{


    /**
     * 充电机状态 0 离线 1 待机 2 充电 3 充满 4 故障
     */
    @Getter
    @Setter
    private int state;

    private String stateStr;

    public String getStateStr() {
        if (state == 0) {
            return "离线";
        } else if (state == 1) {
            return "待机";
        } else if (state == 2) {
            return "充电";
        } else if (state == 3) {
            return "充满";
        } else if (state == 4) {
            return "故障";
        } else {
            return null;
        }
    }
}
