duhuizhe
2024-05-15 aa2c3d4deba76ade0958ff3ced88396e226a4964
ecosphere/ecosphere-four-payment/src/main/java/com/nuvole/four/client/ShopClientFallbackFactory.java
@@ -1,62 +1,61 @@
package com.nuvole.four.client;
import com.nuvole.common.domain.emnu.CommonResultEmnu;
import com.nuvole.common.domain.result.CommonResult;
import com.nuvole.common.domain.result.PageBean;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
@Slf4j
public class ShopClientFallbackFactory implements FallbackFactory<ShopServiceClient> {
    @Override
    public ShopServiceClient create(Throwable throwable) {
        log.error("fallback reason:{}", throwable.getMessage());
        return new ShopServiceClient() {
            @GetMapping(value = "/v1/shop/pc/storeMerchantShop/getMerchantShopExtendList", consumes = "application/json")
            @Override
            public CommonResult<PageBean<Map>> getMerchantShopExtendList(String queryOrgCode, String merchantId, String shopName,
                                                                         String managerName, String channelId,String channelIdNotNull,
                                                                         Integer pageNumber, Integer pageSize) {
                return new CommonResult(CommonResultEmnu.SERVER_ERR);
            }
            @Override
            public List<Map> selectShopMsgByIds(String ids) {
                return null;
            }
            /**
             * 商户活动数据统计-列表
             * @param orgCode       机构code
             * @param channelId     通道id
             * @param activityId    活动id
             * @param startDate     交易开始时间
             * @param endDate       交易结束时间
             * @param pageNumber    页码
             * @param pageSize      每页条数
             * @return  商户活动数据统计-列表
             */
            @Override
            public CommonResult<PageBean<Map>> merchantActivityList(String orgCode, Long channelId, Long activityId, Date startDate,Date endDate, Integer pageNumber, Integer pageSize) {
                return new CommonResult(CommonResultEmnu.SERVER_ERR);
            }
            @Override
            public CommonResult<Map> merchantActivityCollect(String orgCode, Long channelId, Long activityId, Date startDate,Date endDate) {
                return new CommonResult(CommonResultEmnu.SERVER_ERR);
            }
        };
    }
}
//package com.nuvole.four.client;
//
//import com.nuvole.common.domain.emnu.CommonResultEmnu;
//import com.nuvole.common.domain.result.CommonResult;
//import com.nuvole.common.domain.result.PageBean;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//import org.springframework.web.bind.annotation.GetMapping;
//
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//
//
//@Component
//@Slf4j
//public class ShopClientFallbackFactory implements FallbackFactory<ShopServiceClient> {
//
//    @Override
//    public ShopServiceClient create(Throwable throwable) {
//        log.error("fallback reason:{}", throwable.getMessage());
//        return new ShopServiceClient() {
//
//            @GetMapping(value = "/v1/shop/pc/storeMerchantShop/getMerchantShopExtendList", consumes = "application/json")
//            @Override
//            public CommonResult<PageBean<Map>> getMerchantShopExtendList(String queryOrgCode, String merchantId, String shopName,
//                                                                         String managerName, String channelId,String channelIdNotNull,
//                                                                         Integer pageNumber, Integer pageSize) {
//                return new CommonResult(CommonResultEmnu.SERVER_ERR);
//            }
//
//            @Override
//            public List<Map> selectShopMsgByIds(String ids) {
//                return null;
//            }
//
//            /**
//             * 商户活动数据统计-列表
//             * @param orgCode       机构code
//             * @param channelId     通道id
//             * @param activityId    活动id
//             * @param startDate     交易开始时间
//             * @param endDate       交易结束时间
//             * @param pageNumber    页码
//             * @param pageSize      每页条数
//             * @return  商户活动数据统计-列表
//             */
//            @Override
//            public CommonResult<PageBean<Map>> merchantActivityList(String orgCode, Long channelId, Long activityId, Date startDate,Date endDate, Integer pageNumber, Integer pageSize) {
//                return new CommonResult(CommonResultEmnu.SERVER_ERR);
//            }
//
//            @Override
//            public CommonResult<Map> merchantActivityCollect(String orgCode, Long channelId, Long activityId, Date startDate,Date endDate) {
//                return new CommonResult(CommonResultEmnu.SERVER_ERR);
//            }
//
//        };
//    }
//}