package com.vctgo.system.api.factory;


import com.vctgo.common.core.domain.R;
import com.vctgo.system.api.RemotePlatformUserService;
import com.vctgo.system.api.RemoteTeachStaffService;
import com.vctgo.system.api.RemoteTenantService;
import com.vctgo.system.api.domain.SysPlatformUser;
import com.vctgo.system.api.domain.SysTenant;
import com.vctgo.system.api.domain.vo.SysTeachStaffVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class RemoteTeachStaffFallbackFactory implements FallbackFactory<RemoteTeachStaffService> {

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

    @Override
    public RemoteTeachStaffService create(Throwable throwable) {
        log.error("职工服务调用失败:{}", throwable.getMessage());
        return new RemoteTeachStaffService() {

            @Override
            public R<SysTeachStaffVo> getLocationId(Long userId) {
                return null;
            }

            @Override
            public R<SysTeachStaffVo> updateStaffByKinderId(SysTeachStaffVo sysTeachStaffVo) {
                return R.fail("回填教职工信息失败:" + throwable.getMessage());            }
        };
    }
}
