package com.zd.system.api.kkFile.factory;

import com.zd.system.api.kkFile.RemoteKkFileService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.net.URI;

@Component
public class RemoteKkFileServiceFallbackFactory implements FallbackFactory<RemoteKkFileService> {
    @Override
    public RemoteKkFileService create(Throwable throwable) {
        return new RemoteKkFileService(){
            @Override
            public String getKkFilePath(URI uri,@RequestParam("url") String url) {
                return throwable.getMessage();
            }
        };
    }
}
