Browse Source

注释全局RemoteUserFallbackFactory

ZJY 5 months ago
parent
commit
43178f8bb1

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

@@ -1,48 +1,48 @@
-package com.usky.website.factory;
-
-import com.usky.common.core.bean.ApiResult;
-import com.usky.common.core.exception.BusinessException;
-import com.usky.website.RemoteUserService;
-import com.usky.website.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());
-            }
-        };
-    }
-}
+//package com.usky.website.factory;
+//
+//import com.usky.common.core.bean.ApiResult;
+//import com.usky.common.core.exception.BusinessException;
+//import com.usky.website.RemoteUserService;
+//import com.usky.website.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());
+//            }
+//        };
+//    }
+//}

+ 48 - 48
usky-module-demo/usky-module-demo-api/src/main/java/com/usky/demo/factory/RemoteUserFallbackFactory.java

@@ -1,48 +1,48 @@
-package com.usky.demo.factory;
-
-import com.usky.common.core.bean.ApiResult;
-import com.usky.common.core.exception.BusinessException;
-import com.usky.demo.RemoteUserService;
-import com.usky.demo.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());
-            }
-        };
-    }
-}
+//package com.usky.demo.factory;
+//
+//import com.usky.common.core.bean.ApiResult;
+//import com.usky.common.core.exception.BusinessException;
+//import com.usky.demo.RemoteUserService;
+//import com.usky.demo.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());
+//            }
+//        };
+//    }
+//}