- All Implemented Interfaces:
Serializable,Comparable<Channel>,Constable
请求渠道枚举,定义不同的请求来源及其属性。
该枚举类用于标识请求的来源渠道(如 WEB、APP、钉钉、微信等),并为每个渠道关联一个字符串值和令牌类型。 每个枚举值通过构造函数初始化其属性,并提供静态方法 get(String)
用于根据字符串值获取对应的枚举实例。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
WEB
WEB 请求,表示通过浏览器或网页发起的请求。 -
APP
APP 请求,表示通过移动应用程序发起的请求。 -
DINGTALK
钉钉请求,表示通过钉钉平台发起的请求。 -
WECHAT
微信请求,表示通过微信平台发起的请求。 -
OTHER
其他请求,表示无法归类到特定渠道的请求,作为默认回退值。
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
get
根据渠道值获取对应的渠道枚举实例。该方法通过给定的字符串值查找匹配的枚举实例。如果未找到匹配的渠道,则返回
OTHER作为默认值。
-