“mitao”
2026-03-06 412fa709df33fcad4647f394fcebba8f68c2d471
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.xiaopeng.api.factory.account;
 
import com.xiaopeng.api.feignClient.account.XpOperationsRoleClient;
import com.xiaopeng.api.model.account.XpOperationsRole;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
import java.util.ArrayList;
import java.util.List;
 
@Slf4j
@Component
public class XpOperationsRoleClientFallbackFactory implements FallbackFactory<XpOperationsRoleClient> {
 
    @Override
    public XpOperationsRoleClient create(Throwable cause) {
        return operationUserId -> {
            log.error("查询运维人员角色关联失败,operationUserId={}, err={}", operationUserId, cause.getMessage());
            return R.ok(new ArrayList<>());
        };
    }
}