liusuyi
2026-05-18 b5cd784d0cde5b7c82ea78aef4ac0e5a161d8c5d
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
package com.ard.zlm.api.factory;
 
import com.ard.common.core.domain.R;
import com.ard.zlm.api.RemoteZlmRecordPlanService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
/**
 * ZLM录像计划服务降级处理
 *
 * @FileName RemoteZlmRecordPlanFallbackFactory
 * @Description
 * @Author fengcheng
 * @date 2026-04-12
 **/
@Component
public class RemoteZlmRecordPlanFallbackFactory implements FallbackFactory<RemoteZlmRecordPlanService> {
 
    private static final Logger log = LoggerFactory.getLogger(RemoteZlmRecordPlanService.class);
 
    @Override
    public RemoteZlmRecordPlanService create(Throwable throwable) {
        log.error(" ZLM录像计划服务调用失败:{}", throwable.getMessage());
        return new RemoteZlmRecordPlanService(){
            @Override
            public R<Void> task(String inner) {
                return R.fail("ZLM录像计划服务调用失败" + throwable.getMessage());
            }
        };
    }
}