package com.muyu.common.system.remote.factory;
/**
 * @Author: 胡杨
 * @Name: RemoteEntFallbackFactory
 * @Description:
 * @CreatedDate: 2024/9/20 下午3:11
 * @FilePath: com.muyu.common.system.remote
 */


import com.muyu.common.core.domain.Result;
import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.remote.RemoteSaasService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: 胡杨
 * @Name: RemoteEntFallbackFactory
 * @Description:
 * @CreatedDate: 2024/9/20 下午3:11
 * @FilePath: com.muyu.common.system.remote
 */
@Component
public class RemoteSaasFallbackFactory implements FallbackFactory<RemoteSaasService> {
    @Override
    public RemoteSaasService create(Throwable cause) {
        return new RemoteSaasService() {

            @Override
            public Result<SysUser> getUserInfo(String firmCode, String username, String source) {
                return Result.error("获取用户失败:" + cause.getMessage());
            }
        };
    }
}
