package jnpf.cultivate.fallback;

import jnpf.base.ActionResult;
import jnpf.cultivate.FtbCultivatePromotionApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class FtbCultivatePromotionFallback implements FallbackFactory<FtbCultivatePromotionApi> {


    @Override
    public FtbCultivatePromotionApi create(Throwable cause) {
        cause.printStackTrace();
        return new FtbCultivatePromotionApi() {
            @Override
            public ActionResult<Boolean> deleteMembersToProChannel(List<String> userIds) {
                log.error("deleteMembersToProChannel 调用失败...");
                return null;
            }

            @Override
            public ActionResult<Boolean> isThereAnAppForThePosLevel(String postId, String grandId, String userId) {
                log.error("isThereAnAppForThePosLevel 调用失败...");
                return null;
            }
        };
    }

}
