package cn.axzo.msg.center.api.fallback;

import cn.axzo.msg.center.api.MessagePushApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author jiachao
 * @date 2021/5/24
 */
@Component
@Slf4j
public class MessagePushApiFallbackFactory implements FallbackFactory<MessagePushApi> {

  @Override
  public MessagePushApi create(Throwable throwable) {
    MessagePushApiFallback messagePushFallback= new MessagePushApiFallback();
    messagePushFallback.setThrowable(throwable);
    return messagePushFallback;
  }

}
