add:增加mapper生成
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
package org.nl.modules.common.exception;
|
||||
|
||||
|
||||
import org.nl.common.api.ResultCode;
|
||||
|
||||
/**
|
||||
* 业务异常
|
||||
*
|
||||
* @author gbx
|
||||
* @date 2022-03-21
|
||||
*/
|
||||
public class BizCoreException extends RuntimeException{
|
||||
private static final long serialVersionUID = -430613633714952314L;
|
||||
/**
|
||||
* 错误描述,生成错误响应时,如果该值不为空,则返回message,否则返回code对象的描述值
|
||||
*/
|
||||
private String errorMsg;
|
||||
private ResultCode code = ResultCode.FAILED;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(String message) {
|
||||
super(message);
|
||||
this.errorMsg = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(String message, ResultCode code) {
|
||||
super(message);
|
||||
this.errorMsg = message;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(ResultCode code) {
|
||||
super(code.getDesc());
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(String message, Throwable e) {
|
||||
super(message, e);
|
||||
this.errorMsg = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(String message, ResultCode code, Throwable e) {
|
||||
super(message, e);
|
||||
this.errorMsg = message;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(Throwable e) {
|
||||
super(e);
|
||||
this.errorMsg = e.getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*/
|
||||
public BizCoreException(ResultCode code, Throwable e) {
|
||||
super(e);
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ResultCode getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(ResultCode code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getErrorMsg() {
|
||||
return this.errorMsg;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user