【U】新增异常CODE接口类

This commit is contained in:
殷林
2019-08-12 18:22:27 +08:00
parent f2eb6288bc
commit 31f47cbc59
4 changed files with 40 additions and 12 deletions

View File

@@ -110,6 +110,10 @@ public class Utils {
}
}
}
return getExceptionInfo(e, errInfo);
}
private static String getExceptionInfo(Throwable e, String errInfo) {
StringBuilder sb = new StringBuilder(e.getClass().getSimpleName());
String message = e.getMessage();
if (null != message) {
@@ -146,15 +150,7 @@ public class Utils {
}
}
}
StringBuilder sb = new StringBuilder(e.getClass().getSimpleName());
String message = e.getMessage();
if (null != message) {
sb.append(':').append(message);
}
if (null != errInfo) {
sb.append(':').append(errInfo);
}
return sb.toString();
return getExceptionInfo(e, errInfo);
}
/**

View File

@@ -0,0 +1,25 @@
package cn.org.easysite.framework.exception;
/**
* @author : yinlin
* @version : 1.0
* @date : 2019-08-12 13:36
* @Description :
* @Copyright : Copyright (c) 2019
* @Company : EasySite Technology Chengdu Co. Ltd.
* @link : cn.org.easysite.framework.exception.ErrorCode
*/
public interface ErrorCode {
/**
* 获得错误码
* @return
*/
String getErrorCode();
/**
*
* @return
*/
String getErrorMessage();
}

View File

@@ -12,16 +12,19 @@ import lombok.extern.slf4j.Slf4j;
import static cn.org.easysite.framework.utils.ExceptionTool.createBaseException;
/**
* @author liangb
* @author panda
* @version 1.0
* @date 16/7/7 下午2:15
* @date 19/7/7 下午2:15
*/
@Slf4j
public class SignUtils {
private static final String SIGN_SHA1 = "SHA1";
private static final String SIGN_MD5 = "MD5";
private static final char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
private static final String KEY_STR = "&key=";//SHA1签名拼接的字符串
/**
* SHA1签名拼接的字符串
*/
private static final String KEY_STR = "&key=";
/**
* RSA签名

View File

@@ -6,6 +6,10 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
import java.util.ArrayList;
import java.util.List;
/**
* 针对返回类型是text/plain类型的结果返回是json增加解析
* @author yinlin
*/
public class TextPlainMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter {
public TextPlainMappingJackson2HttpMessageConverter() {