فهرست منبع

Merge branch 'usky-zyj' of uskycloud/usky-modules into server-165

James 10 ماه پیش
والد
کامیت
7d917de9a0

+ 0 - 28
service-fire/service-fire-api/src/main/java/com/usky/fire/RemoteUserService.java

@@ -1,28 +0,0 @@
-package com.usky.fire;
-
-
-import com.usky.common.core.bean.ApiResult;
-import com.usky.fire.domain.SysUserVO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
-
-@FeignClient(contextId = "remoteUserService", value = "usky-demo")
-public interface RemoteUserService {
-
-
-
-    @GetMapping("/byUserName")
-    ApiResult<List<SysUserVO>> getByUserName(@RequestParam("userName") String userName);
-
-
-    @PostMapping("/byUserName")
-    ApiResult<List<SysUserVO>> add(@RequestBody SysUserVO sysUserVO);
-
-
-    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    ApiResult<String> upload(@RequestPart(value = "file") MultipartFile file);
-}

+ 5 - 19
service-fire/service-fire-api/src/main/java/com/usky/fire/factory/RemoteFireFallbackFactory.java

@@ -2,15 +2,11 @@ package com.usky.fire.factory;
 
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.exception.BusinessException;
-import com.usky.fire.RemoteUserService;
-import com.usky.fire.domain.SysUserVO;
+import com.usky.fire.RemoteFireService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
 
 
 /**
@@ -19,27 +15,17 @@ import java.util.List;
  * @author ruoyi
  */
 @Component
-public class RemoteFireFallbackFactory implements FallbackFactory<RemoteUserService>
+public class RemoteFireFallbackFactory implements FallbackFactory<RemoteFireService>
 {
     private static final Logger log = LoggerFactory.getLogger(RemoteFireFallbackFactory.class);
 
     @Override
-    public RemoteUserService create(Throwable throwable)
+    public RemoteFireService create(Throwable throwable)
     {
         log.error("用户服务调用失败:{}", throwable.getMessage());
-        return new RemoteUserService() {
-            @Override
-            public ApiResult<List<SysUserVO>> getByUserName(String userName) {
-                throw new BusinessException(throwable.getMessage());
-            }
-
-            @Override
-            public ApiResult<List<SysUserVO>> add(SysUserVO sysUserVO) {
-                throw new BusinessException(throwable.getMessage());
-            }
-
+        return new RemoteFireService() {
             @Override
-            public ApiResult<String> upload(MultipartFile file) {
+            public ApiResult<Void> addPatrolInspectionAbnormalData() {
                 throw new BusinessException(throwable.getMessage());
             }
         };

+ 0 - 48
service-fire/service-fire-api/src/main/java/com/usky/fire/factory/RemoteUserFallbackFactory.java

@@ -1,48 +0,0 @@
-package com.usky.fire.factory;
-
-import com.usky.common.core.bean.ApiResult;
-import com.usky.common.core.exception.BusinessException;
-import com.usky.fire.RemoteUserService;
-import com.usky.fire.domain.SysUserVO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.cloud.openfeign.FallbackFactory;
-import org.springframework.stereotype.Component;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.List;
-
-
-/**
- * 用户服务降级处理
- *
- * @author ruoyi
- */
-@Component
-public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService>
-{
-    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);
-
-    @Override
-    public RemoteUserService create(Throwable throwable)
-    {
-        log.error("用户服务调用失败:{}", throwable.getMessage());
-        return new RemoteUserService() {
-            @Override
-            public ApiResult<List<SysUserVO>> getByUserName(String userName) {
-                throw new BusinessException(throwable.getMessage());
-            }
-
-            @Override
-            public ApiResult<List<SysUserVO>> add(SysUserVO sysUserVO) {
-                throw new BusinessException(throwable.getMessage());
-            }
-
-            @Override
-            public ApiResult<String> upload(MultipartFile file) {
-                throw new BusinessException(throwable.getMessage());
-            }
-        };
-    }
-}