package com.xunmei.system.api.factory;

import com.xunmei.common.core.domain.R;
import com.xunmei.common.core.web.domain.AjaxResult;
import com.xunmei.system.api.RemoteTaskService;
import com.xunmei.system.api.RemoteUserService;
import com.xunmei.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteTaskFallbackFactory implements FallbackFactory<RemoteTaskService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);
    @Override
    public RemoteTaskService create(Throwable throwable) {

        log.error("用户服务调用失败:{}", throwable.getMessage());
        return new RemoteTaskService()
        {

            @Override
            public R<AjaxResult> dayTask() {
                return null;
            }

            @Override
            public R<AjaxResult> weekTask() {
                return null;
            }

            @Override
            public R<AjaxResult> monthTask() {
                return null;
            }
        };
    }
}
