package com.sptg.estate.api.feigns.fallback;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.estate.api.feigns.NoticePushDetailsFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * title: NoticePushDetailsFeignFallbackFactory
 * package: com.sptg.estate.api.feigns.fallback
 * description:
 *
 *                  
 *               
 */
@Component
@Slf4j
public class NoticePushDetailsFeignFallbackFactory implements FallbackFactory<NoticePushDetailsFeign> {


    @Override
    public NoticePushDetailsFeign create(Throwable cause) {
        return (dto) -> {
            log.error(cause.getMessage(),cause);
            return new ResultBean<>(ResultEnum.ERROR);
        };
    }

}
