package com.yd.oss.feign.fallback;

import com.yd.common.result.Result;
import com.yd.oss.feign.client.ApiOssStsFeignClient;
import com.yd.oss.feign.response.ApiGetStsTokenResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * OSS服务信息Feign降级处理
 */
@Slf4j
@Component
public class ApiOssStsFeignFallbackFactory implements FallbackFactory<ApiOssStsFeignClient> {
    @Override
    public ApiOssStsFeignClient create(Throwable cause) {
        return new ApiOssStsFeignClient() {
            @Override
            public Result<ApiGetStsTokenResponse> getStsToken() {
                return null;
            }
        };
    }
}
