package com.zd.system.api.smartlock.factory;

import com.zd.common.core.domain.R;
import com.zd.system.api.smartlock.RemoteSmartlockService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteSmartlockFallbackFactory implements FallbackFactory<RemoteSmartlockService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteSmartlockFallbackFactory.class);


    @Override
    public RemoteSmartlockService create(Throwable cause) {
        return new RemoteSmartlockService() {
            @Override
            public R sysMsgApprova(String phone, String content, Long lockApplyId) {
                log.info("短信审核处理失败:" + cause.getMessage());
                return R.fail("短信审核处理失败："+ cause.getMessage());
            }
        };

    }
}
