package com.yd.oss.feign.fallback;

import com.yd.common.result.Result;
import com.yd.oss.feign.client.ApiOssStsFeignClient;
import com.yd.oss.feign.request.ApiBatchSaveFilesRequest;
import com.yd.oss.feign.response.ApiBatchSaveFilesResponse;
import com.yd.oss.feign.response.ApiGetStsTokenResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

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

            @Override
            public Result<ApiBatchSaveFilesResponse> batchSaveFiles(ApiBatchSaveFilesRequest request) {
                return null;
            }
        };
    }
}
