提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.base.auth.exception; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.roses.kernel.model.exception.AbstractBaseExceptionEnum; |
|
4 |
import lombok.Data; |
|
5 |
|
|
6 |
import static cn.stylefeng.guns.base.auth.exception.enums.AuthExceptionEnum.NO_PERMISSION; |
|
7 |
|
|
8 |
/** |
|
9 |
* 没有访问权限 |
|
10 |
* |
|
11 |
* @author fengshuonan |
|
12 |
* @Date 2019/7/18 22:18 |
|
13 |
*/ |
|
14 |
@Data |
|
15 |
public class PermissionException extends RuntimeException { |
|
16 |
|
|
17 |
private Integer code; |
|
18 |
private String errorMessage; |
|
19 |
|
|
20 |
public PermissionException() { |
|
21 |
super(NO_PERMISSION.getMessage()); |
|
22 |
this.code = NO_PERMISSION.getCode(); |
|
23 |
this.errorMessage = NO_PERMISSION.getMessage(); |
|
24 |
} |
|
25 |
|
|
26 |
public PermissionException(AbstractBaseExceptionEnum exception) { |
|
27 |
super(exception.getMessage()); |
|
28 |
this.code = exception.getCode(); |
|
29 |
this.errorMessage = exception.getMessage(); |
|
30 |
} |
|
31 |
|
|
32 |
} |