package org.springblade.system.client.factory;

import lombok.extern.slf4j.Slf4j;
import org.springblade.system.client.MenuClient;
import org.springblade.system.client.model.BladeMenuModel;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class MenuClientFallbackFactory implements FallbackFactory<MenuClient> {
    @Override
    public MenuClient create(Throwable cause) {
        log.error("SmsClient invoke fallback:{}", cause.getMessage());
        return new MenuClient() {
            @Override
            public List<BladeMenuModel> getByTenantId(String tenantId) {
                return null;
            }

            @Override
            public void saveList(List<BladeMenuModel> menuModels) {

            }

            @Override
            public Long save(BladeMenuModel menuModel) {
                return null;
            }
        };
    }
}
