package com.vctgo.system.api.factory;

import com.vctgo.common.core.domain.R;
import com.vctgo.system.api.RemotePlatformUserService;
import com.vctgo.system.api.RemoteUserService;
import com.vctgo.system.api.domain.SysPlatformUser;
import com.vctgo.system.api.domain.dto.VoteExpertWorkingPlatformDto;
import com.vctgo.system.api.domain.vo.VoteExpertSubmissionCountVo;
import com.vctgo.system.api.domain.vo.VoteExpertSubmissionVo;
import com.vctgo.system.api.domain.vo.VoteExpertWorkingPlatformVo;
import com.vctgo.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author feng
 * @date 2024/8/14
 */
@Component
public class RemotePlatformUserFactory implements FallbackFactory<RemotePlatformUserService> {

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

    @Override
    public RemotePlatformUserService create(Throwable throwable) {
        log.error("专家服务调用失败:{}", throwable.getMessage());
        return new RemotePlatformUserService() {
            @Override
            public R<List<SysPlatformUser>> processExpertList() {
                return R.fail("获取专家列表失败:" + throwable.getMessage());
            }
        };
    }
}
