无关风月
2024-12-31 0c51a577db337520452022d9d6a22b720ef858d4
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
package com.xinquan.system.api.factory;
 
import com.xinquan.common.core.domain.R;
import com.xinquan.system.api.RemoteHotWordsService;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
/**
 * 用户服务降级处理
 *
 * @author ruoyi
 */
@Component
public class RemoteHotWordsFallbackFactory implements FallbackFactory<RemoteHotWordsService> {
 
    private static final Logger log = LoggerFactory.getLogger(RemoteHotWordsFallbackFactory.class);
 
    @Override
    public RemoteHotWordsService create(Throwable cause) {
        return new RemoteHotWordsService() {
            @Override
            public R<List<String>> getHotWordList(String source) {
                return R.fail("获取热词列表失败");
            }
        };
    }
}