clean code
This commit is contained in:
parent
8556f5ae4a
commit
5fa31e6a0f
|
|
@ -1,14 +0,0 @@
|
|||
package com.electromagnetic.industry.software.common.enums;
|
||||
|
||||
public interface ErrorEnum {
|
||||
|
||||
String getCodeType();
|
||||
|
||||
String getCodeLevel();
|
||||
|
||||
String getCode();
|
||||
|
||||
String getErrorMessage();
|
||||
|
||||
String getErrorDesc();
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.electromagnetic.industry.software.common.enums;
|
||||
|
||||
/**
|
||||
* @author wsk
|
||||
* @version $Id: ErrorLevels.java, v 0.1 2024-10-17 17:44 wsk
|
||||
*/
|
||||
public interface ErrorLevels {
|
||||
|
||||
/**
|
||||
* INFO级别
|
||||
*/
|
||||
public static final String INFO = "1";
|
||||
|
||||
/**
|
||||
* WARN级别
|
||||
*/
|
||||
public static final String WARN = "3";
|
||||
|
||||
/**
|
||||
* ERROR级别
|
||||
*/
|
||||
public static final String ERROR = "5";
|
||||
|
||||
/**
|
||||
* FATAL级别
|
||||
*/
|
||||
public static final String FATAL = "7";
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
package com.electromagnetic.industry.software.common.enums;
|
||||
|
||||
public interface ErrorTypes {
|
||||
|
||||
/**
|
||||
* 系统错误
|
||||
*/
|
||||
public static final String SYSTEM = "0";
|
||||
|
||||
/**
|
||||
* 业务错误
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String BIZ = "1";
|
||||
|
||||
/**
|
||||
* 第三方错误
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String THIRD_PARTY = "2";
|
||||
|
||||
/**
|
||||
* 业务错误,客户感知
|
||||
*/
|
||||
public static final String BIZ_CUSTOMER = "9";
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
package com.electromagnetic.industry.software.common.util;
|
||||
|
||||
import com.electromagnetic.industry.software.common.enums.ErrorEnum;
|
||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
||||
|
||||
public class ElectromagneticResultUtil {
|
||||
|
|
@ -21,13 +20,4 @@ public class ElectromagneticResultUtil {
|
|||
return electromagneticResult;
|
||||
}
|
||||
|
||||
public static <T> ElectromagneticResult fail(ErrorEnum errorEnum) {
|
||||
ElectromagneticResult<T> electromagneticResult = new ElectromagneticResult<>();
|
||||
electromagneticResult.setSuccess(false);
|
||||
electromagneticResult.setErrorCode(errorEnum.getCode());
|
||||
electromagneticResult.setErrorMessage(errorEnum.getErrorMessage());
|
||||
return electromagneticResult;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue