mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 18:49:06 +08:00 
			
		
		
		
	enum 增加 valueOfType
This commit is contained in:
		| @ -23,4 +23,14 @@ public enum ChatRoleSourceEnum { | ||||
|     private String type; | ||||
|  | ||||
|     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 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); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 cherishsince
					cherishsince