/**
 * 
 */
package org.springblade.system.client.factory;

import org.springblade.system.client.SmsClient;
import org.springblade.system.client.model.SmsModel;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * @author wookvn
 *
 */
@Slf4j
@Component
public class SmsClientFallbackFactory implements FallbackFactory<SmsClient> {

	@Override
	public SmsClient create(Throwable cause) {
		log.error("SmsClient invoke fallback:{}", cause.getMessage());
		return new SmsClient() {
			@Override
			public SmsModel getById(Integer id) {
				return null;
			}
		};
	}

}
