mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 09:30:05 +08:00
enum 增加 valueOfType
This commit is contained in:
parent
e4dc715458
commit
c75e415b61
@ -23,4 +23,14 @@ public enum ChatRoleSourceEnum {
|
|||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
public static ChatRoleSourceEnum valueOfType(String type) {
|
||||||
|
for (ChatRoleSourceEnum itemEnum : ChatRoleSourceEnum.values()) {
|
||||||
|
if (itemEnum.getType().equals(type)) {
|
||||||
|
return itemEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid MessageType value: " + type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,4 +22,15 @@ public enum ChatRoleVisibilityEnum {
|
|||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
public static ChatRoleVisibilityEnum valueOfType(String type) {
|
||||||
|
for (ChatRoleVisibilityEnum itemEnum : ChatRoleVisibilityEnum.values()) {
|
||||||
|
if (itemEnum.getType().equals(type)) {
|
||||||
|
return itemEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Invalid MessageType value: " + type);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user