throw new BusinessException 这里没看懂
来源:9-4 用户名重复校验与自定义异常

慕村0495880
2022-11-02
“throw new BusinessException(BusinessExceptionCode.USER_LOGIN_NAME_EXIST);”
根据我们后面类的定义这里不应该传入BusinessExceptionCode就可以了么,为什么是传入BusinessExceptionCode.USER_LOGIN_NAME_EXIST呢?
写回答
1回答
-
甲蛙
2022-11-04
BusinessExceptionCode是一个枚举类,在使用枚举类做参数的时候,传入的是枚举类里具体的一种类型,而不是这个枚举类
00
相似问题