mitao
2025-01-10 b9679b6f96bbe8b52ee1d699033d9021d5fe870f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.ruoyi.system.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.dto.AppShoppingCartDelDto;
import com.ruoyi.system.api.service.RemoteShoppingCartService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
/**
 * @author jqs34
 * @ClassName RemoteShoppingCartFallbackFactory
 * @description: TODO
 * @date 2023年05月23日
 * @version: 1.0
 */
@Component
public class RemoteShoppingCartFallbackFactory implements FallbackFactory<RemoteShoppingCartService> {
 
    private static final Logger log = LoggerFactory.getLogger(RemoteMemberFallbackFactory.class);
 
    @Override
    public RemoteShoppingCartService create(Throwable throwable)
    {
        log.error("购物车服务调用失败:{}", throwable.getMessage());
        return new RemoteShoppingCartService()
        {
 
            @Override
            public R deleteShoppingCart(AppShoppingCartDelDto appShoppingCartDelDto) {
                return R.fail("删除购物车户失败:" + throwable.getMessage());
            }
        };
    }
}