Browse Source

更新:
openFeign 添加throw Exception

wuweihao 4 years ago
parent
commit
c1c57bb4b2

+ 1 - 1
cms_pano_fcb/gis_common/src/main/java/com/gis/common/util/Result.java

@@ -25,7 +25,7 @@ public class Result<T> implements Serializable {
     /**
      * 处理状态:0: 成功, 1: 失败
      */
-    @ApiModelProperty(value = "处理状态:0: 成功, 1: 失败", name = "code")
+    @ApiModelProperty(value = "处理状态:0: 成功, -1: 失败", name = "code")
     private int code;
     /**
      * 消息

+ 1 - 1
cms_pano_fcb/gis_service/src/main/java/com/gis/feign/HouseFeign.java

@@ -33,7 +33,7 @@ public interface HouseFeign {
     Result findByHouseId(@RequestParam String houseId) throws Exception;
 
     @PostMapping(value = "/fcb/project/operation/addNew", consumes = MediaType.APPLICATION_JSON_VALUE, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
-    Result addLog(@RequestBody LogInfoDto param);
+    Result addLog(@RequestBody LogInfoDto param) throws Exception;
 
 
     /**

+ 6 - 1
cms_pano_fcb/gis_service/src/main/java/com/gis/service/impl/SceneServiceImpl.java

@@ -655,7 +655,12 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, String> impl
             param.setSceneName(searchKey);
         }
 
-        Result result = sceneProFeign.findByList(param, token);
+        Result result = null;
+        try {
+            result = sceneProFeign.findByList(param, token);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
         // 过滤已添加的数据
         if (result.getCode() == 0) {

+ 6 - 5
cms_pano_fcb/gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java

@@ -113,17 +113,18 @@ public class WebLogAspect {
             logInfoDto.setCreateTime(now);
             logInfoDto.setOperateTime(now);
 
+        try {
             houseFeign.addLog(logInfoDto);
+        } catch (Exception e) {
+            //下面这个getSignature().getDeclaringTypeName()是获取包+类名的   然后后面的joinPoint.getSignature.getName()获取了方法名
+            log.info("request Class_Method : {}" , joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
+            e.printStackTrace();
+        }
 
 
 
 
 
-        //下面这个getSignature().getDeclaringTypeName()是获取包+类名的   然后后面的joinPoint.getSignature.getName()获取了方法名
-        log.info("request Class_Method : {}" , joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
-
-
-
     }