Explorar el Código

优化 api 框架层 处理日志处的bug

java110 hace 4 años
padre
commit
65850daec8

+ 1 - 1
service-api/src/main/java/com/java110/api/bmo/community/impl/CommunityBMOImpl.java

@@ -106,7 +106,7 @@ public class CommunityBMOImpl extends ApiBaseBMO implements ICommunityBMO {
         communityDto.setCommunityId(paramInJson.getString("communityId"));
         List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
 
-        Assert.listOnlyOne(communityDtos, "小区不存");
+        Assert.listOnlyOne(communityDtos, "小区不存");
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_MEMBER_JOINED_COMMUNITY);

+ 5 - 5
service-api/src/main/java/com/java110/api/smo/impl/ApiServiceSMOImpl.java

@@ -99,16 +99,16 @@ public class ApiServiceSMOImpl extends LoggerEngine implements IApiServiceSMO {
             responseEntity = dataFlow.getResponseEntity();
 
         } catch (DecryptException e) { //解密异常
-            responseEntity = ResultVo.error("解密异常:" + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+            responseEntity = ResultVo.error("解密异常:" + e.getMessage());
         } catch (BusinessException e) {
-            responseEntity = ResultVo.error(e.getMessage(), HttpStatus.BAD_REQUEST);
+            responseEntity = ResultVo.error(e.getMessage());
         } catch (NoAuthorityException e) {
-            responseEntity = ResultVo.error("鉴权失败:" + e.getMessage(), HttpStatus.UNAUTHORIZED);
+            responseEntity = ResultVo.error("鉴权失败:" + e.getMessage());
         } catch (InitConfigDataException e) {
-            responseEntity = ResultVo.error("初始化失败:" + e.getMessage(), HttpStatus.BAD_REQUEST);
+            responseEntity = ResultVo.error("初始化失败:" + e.getMessage());
         } catch (Exception e) {
             logger.error("内部异常:", e);
-            responseEntity = ResultVo.error("内部异常:" + e.getMessage() + e.getLocalizedMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+            responseEntity = ResultVo.error("内部异常:" + e.getMessage() + e.getLocalizedMessage());
         } finally {
             Date endDate = DateUtil.getCurrentDate();
             if (dataFlow != null) {