/*
 *  Copyright 2019-2025 Tz
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package me.zhengjie.modules.security.config.enums;

/**
 * ErrorStatusEnum
 */
public enum ErrorStatusEnum {

	SDCP_PRINT_ERROR_DEFAULT(-1, "默认/断开"),
	SDCP_PRINT_ERROR_NONE(0  ,"正常"),
	SDCP_PRINT_ERROR_CHECKFILE(1  ,"文件校验失败"),
	SDCP_PRINT_ERROR_DEVICE(2  ,"设备或加密出错"),
	SDCP_PRINT_ERROR_PREPARE(3  ,"打印准备过程出错"),
	SDCP_PRINT_ERROR_PRINT(4  ,"打印出错"),
	SDCP_PRINT_ERROR_LIQUID(5 ,"加液失败"),
	SDCP_PRINT_ERROR_SPADE(6 ,"铲件失败"),
	SDCP_PRINT_ERROR_PIC(7 ,"图片异物"),
	;

	private Integer code;
	private String text;

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	ErrorStatusEnum(Integer code, String text) {
		this.code = code;
		this.text = text;
	}

	public static ErrorStatusEnum getEnumByNum(int value) {
		for (ErrorStatusEnum os : ErrorStatusEnum.values()) {
			if (value == os.getCode()) {
				return os;
			}
		}
		return null;
	}
}
