package com.xunmei.system.api.factory;

import com.xunmei.common.core.domain.R;
import com.xunmei.common.core.utils.Ymd;
import com.xunmei.system.api.RemoteWorkTimeService;
import com.xunmei.system.api.domain.SysWorkTime;
import com.xunmei.system.api.factory.RemoteOrgFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RemoteWorkTimesFallbackFactory implements FallbackFactory<RemoteWorkTimeService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteWorkTimesFallbackFactory.class);

    @Override
    public RemoteWorkTimeService create(Throwable throwable) {
        log.error("用户服务调用失败:{}", throwable.getMessage());
        return new RemoteWorkTimeService() {
            @Override
            public R<List<Long>> findOrgIdsByYmd(String toYmd, String source) {
                return null;
            }

            @Override
            public R<SysWorkTime> findWorkTimeByYmd(Ymd ymd) {
                return null;
            }


            @Override
            public R<Boolean> existByYmd(Ymd ymd) {
                return null;
            }
        };
    }
}
