Pu Zhibing
2025-05-08 afdd96be3f266ee04e7c4a427eb010708e1cace3
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
package com.ruoyi.goods.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.goods.api.domain.LotteryEvent;
import com.ruoyi.goods.api.service.LotteryEventClient;
import org.springframework.cloud.openfeign.FallbackFactory;
 
import java.util.List;
 
/**
 * @author zhibing.pu
 * @Date 2025/5/8 18:12
 */
public class LotteryEventFallbackFactory implements FallbackFactory<LotteryEventClient> {
    @Override
    public LotteryEventClient create(Throwable cause) {
        return new LotteryEventClient() {
            
            @Override
            public R<List<LotteryEvent>> getLotteryEventList(Integer activityType) {
                return R.fail("根据开启方式获取活动列表失败:" + cause.getMessage());
            }
        };
    }
}