PreventRepeatSubmit
This commit is contained in:
parent
0969b4d3cf
commit
0d64197abf
|
|
@ -1,5 +1,9 @@
|
||||||
package com.bonus.common.biz.constant;
|
package com.bonus.common.biz.constant;
|
||||||
|
/**
|
||||||
|
* 仓储站点配置项
|
||||||
|
*
|
||||||
|
* @author bonus
|
||||||
|
*/
|
||||||
public class BmConfigItems {
|
public class BmConfigItems {
|
||||||
public final String LEASE_AUDIT_ROLE_KEYS = "LeaseAuditRoleKeys";
|
public final String LEASE_AUDIT_ROLE_KEYS = "LeaseAuditRoleKeys";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
package com.bonus.common.biz.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户状态
|
|
||||||
*
|
|
||||||
* @author bonus
|
|
||||||
*/
|
|
||||||
public enum UserStatus
|
|
||||||
{
|
|
||||||
//正常
|
|
||||||
OK("0", "正常"),
|
|
||||||
//停用
|
|
||||||
DISABLE("1", "停用"),
|
|
||||||
//删除
|
|
||||||
DELETED("2", "删除");
|
|
||||||
|
|
||||||
private final String code;
|
|
||||||
private final String info;
|
|
||||||
|
|
||||||
UserStatus(String code, String info)
|
|
||||||
{
|
|
||||||
this.code = code;
|
|
||||||
this.info = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode()
|
|
||||||
{
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInfo()
|
|
||||||
{
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
package com.bonus.common.biz.utils;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 错误信息处理类。
|
|
||||||
* 提供获取异常详细信息和根本错误信息的工具方法。
|
|
||||||
* 作者: bonus
|
|
||||||
*/
|
|
||||||
public class ExceptionUtil {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取异常的详细错误信息。
|
|
||||||
*
|
|
||||||
* @param e 需要处理的异常
|
|
||||||
* @return 异常的详细错误信息字符串
|
|
||||||
*/
|
|
||||||
public static String getExceptionMessage(Throwable e) {
|
|
||||||
// 使用StringWriter来保存异常的堆栈信息
|
|
||||||
StringWriter sw = new StringWriter();
|
|
||||||
// 将异常的堆栈信息打印到StringWriter中
|
|
||||||
e.printStackTrace(new PrintWriter(sw, true));
|
|
||||||
// 返回异常的详细信息
|
|
||||||
return sw.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取异常的根本错误信息。
|
|
||||||
*
|
|
||||||
* @param e 需要处理的异常
|
|
||||||
* @return 根本错误信息字符串,如果没有错误信息返回空字符串
|
|
||||||
*/
|
|
||||||
public static String getRootErrorMessage(Exception e) {
|
|
||||||
// 获取异常的根本原因
|
|
||||||
Throwable root = ExceptionUtils.getRootCause(e);
|
|
||||||
// 如果没有根本原因,则使用原始异常
|
|
||||||
root = (root == null ? e : root);
|
|
||||||
// 如果根本原因为空,返回空字符串
|
|
||||||
if (root == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
// 获取根本原因的错误信息
|
|
||||||
String msg = root.getMessage();
|
|
||||||
// 如果错误信息为空,返回"null"
|
|
||||||
if (msg == null) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
// 使用StringUtils.defaultString确保返回的错误信息不是null
|
|
||||||
return StringUtils.defaultString(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue