Commit 553f9f9c 孙克

API返回值获取判断修改

API地址修改
1 个父辈 17b48921
......@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.utils.ThrowableUtil;
import com.neotel.smfcore.core.language.util.MessageUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.connector.ClientAbortException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......@@ -41,6 +42,16 @@ public class GlobalExceptionHandler {
/**
* BadCredentialsException
*/
@ExceptionHandler(ClientAbortException.class)
public ResponseEntity<ApiError> clientAbortException( ClientAbortException e){
// 打印堆栈信息
log.warn(e.getMessage());
return buildResponseEntity(ApiError.error(e.getMessage()));
}
/**
* BadCredentialsException
*/
@ExceptionHandler(BadCredentialsException.class)
public ResponseEntity<ApiError> badCredentialsException( BadCredentialsException e){
// 打印堆栈信息
......
......@@ -28,7 +28,7 @@ public class MicronResult implements Serializable {
private String responseData;
public boolean isSuccess() {
if (ObjectUtil.isNotEmpty(status) && status.equals("Success")) {
if (ObjectUtil.isNotEmpty(status) && status.equalsIgnoreCase("Success")) {
return true;
}
return false;
......@@ -52,7 +52,7 @@ public class MicronResult implements Serializable {
}
Object resultStatus = resultMap.get("status");
if (resultStatus != null && !resultStatus.toString().equalsIgnoreCase("SUCCESSS")) {
if (resultStatus != null && !resultStatus.toString().equalsIgnoreCase("SUCCESS")) {
Object msgObj = resultMap.get("message") ;
if(ObjectUtil.isEmpty(msgObj)){
throw new ApiException("smfcore.api.error", "status="+resultStatus);
......
......@@ -67,7 +67,7 @@ public class TokenFilter extends GenericFilterBean {
try {
onlineUserDto = onlineUserService.getOne(properties.getOnlineKey() + token);
} catch (ExpiredJwtException e) {
log.error(e.getMessage());
//log.error(e.getMessage());
}
if (onlineUserDto != null && StringUtils.hasText(token)) {
Authentication authentication = tokenProvider.getAuthentication(token);
......
micron:
apiAddr: https://testapigtwy.micron.com/t/app.mfg/mmsil/v1/DEVL/SINGAPORE/
apiAddr: http://istio-ingressgateway-istio-system.apps.ose-dev45.micron.com/
api_name_001: material/validation/label
api_name_002: material/transfer-in
api_name_004: operation/dispatchIds?operationId={0}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!