https://blog.csdn.net/qq_26676207/article/details/80405497
if(AccessTokenStatusEnum.valueOfByValue(tokenDO.getAccessTokenStatus()) != AccessTokenStatusEnum.VALID){
logger.info("{},{},token is invalid ",tokenDO.getAccessTokenStatus(),tokenDO.getAuthRefreshToken());
throw new OauthException(OauthErrorCodeEnum.ILLEGAL_ARGUMENT,"token is invalid");
}
还有就是 枚举类中的 Valueof的使用
public class Test {
public static void main(String[] args) {
//下面两个东西是一样的
ResultEnum resultEnum = ResultEnum.valueOf("EXPORT_ULTRALIMIT");
ResultEnum resultEnum1 = ResultEnum.valueOf(ResultEnum.class,"EXPORT_ULTRALIMIT");
System.out.println(resultEnum1.getCode());
System.out.println(resultEnum1.getDesc());
System.out.println(JSON.toJSONString(resultEnum1));
}
}