From 6762f7a204a43e2cf4eaae3503d0621d224d4d88 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 20 一月 2025 09:14:55 +0800
Subject: [PATCH] 修改bug
---
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/status/ChargingGunStatusEnum.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/status/ChargingGunStatusEnum.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/status/ChargingGunStatusEnum.java
new file mode 100644
index 0000000..219aea2
--- /dev/null
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/status/ChargingGunStatusEnum.java
@@ -0,0 +1,50 @@
+package com.ruoyi.common.core.enums.status;
+
+import lombok.Getter;
+
+/**
+ * @Description
+ * @Author xiaochen
+ * @Date 2023/6/8 16:42
+ */
+public enum ChargingGunStatusEnum {
+
+
+ OFFLINE(1, "离线"),
+ IDLE(2, "空闲"),
+ OCCUPATION_UNCHARGED(3, "占用(未充电)"),
+ OCCUPATION_CHARGING(4, "占用(充电中)"),
+ OCCUPATION_FULL(5, "占用(已充满)"),
+ OCCUPATION_LOCK(6, "占用(预约锁定)"),
+ FAULT(7, "故障");
+
+ @Getter
+ private String desc;
+
+
+ @Getter
+ private int code;
+
+
+ ChargingGunStatusEnum(int code, String desc) {
+ this.code = code;
+ this.desc = desc;
+ }
+
+ /**
+ * 通过code获取枚举
+ *
+ * @param code
+ * @return
+ */
+ public static ChargingGunStatusEnum fromCode(Integer code) {
+ ChargingGunStatusEnum[] resultTypes = ChargingGunStatusEnum.values();
+ for (ChargingGunStatusEnum resultType : resultTypes) {
+ if (code.equals(resultType.getCode())) {
+ return resultType;
+ }
+ }
+ return null;
+ }
+
+}
--
Gitblit v1.7.1