|
@@ -0,0 +1,53 @@
|
|
|
+package com.diagbot.enums;
|
|
|
+
|
|
|
+import com.diagbot.core.KeyedNamed;
|
|
|
+
|
|
|
+import lombok.Setter;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author wangfeng
|
|
|
+ * @Description: 数据来源
|
|
|
+ * @date 2019年4月4日 上午9:56:09
|
|
|
+ */
|
|
|
+public enum DataSourcesEnums implements KeyedNamed{
|
|
|
+
|
|
|
+ Leading(1, "前端"),
|
|
|
+ After(2, "后端"),
|
|
|
+ BigData(3,"大数据");
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private Integer key;
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ DataSourcesEnums(Integer key, String name) {
|
|
|
+ this.key = key;
|
|
|
+ this.name = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static DataSourcesEnums getEnum(Integer key) {
|
|
|
+ for (DataSourcesEnums item : DataSourcesEnums.values()) {
|
|
|
+ if (item.key == key) {
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String getName(Integer key) {
|
|
|
+ DataSourcesEnums item = getEnum(key);
|
|
|
+ return item != null ? item.name : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getKey() {
|
|
|
+ return key;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+}
|