parent
85eb4b794d
commit
fdb66ce505
@ -0,0 +1,26 @@
|
||||
package com.zh.project0512.utils;
|
||||
|
||||
import com.zh.project0512.utils.result.HttpStatusEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class BizException extends RuntimeException{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
|
||||
public BizException(HttpStatusEnum httpStatusEnum) {
|
||||
this.code = httpStatusEnum.code();
|
||||
this.message = httpStatusEnum.reasonPhraseCN();
|
||||
}
|
||||
|
||||
public BizException(HttpStatusEnum httpStatusEnum, String message) {
|
||||
this.code = httpStatusEnum.code();
|
||||
this.message = message;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue