package com.muyu.remote.factory;

import com.muyu.common.core.domain.Result;
import com.muyu.common.system.domain.SysUser;
import com.muyu.remote.RemoteFirmUserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * 公司员工信息工厂
 * @Author WangXin
 * @Data 2024/10/9
 * @Version 1.0.0
 */
@Log4j2
public class RemoteFirmFallbackFactory implements FallbackFactory<RemoteFirmUserService> {

    @Override
    public RemoteFirmUserService create(Throwable cause) {
        return new RemoteFirmUserService() {

            @Override
            public Result<SysUser> info(String username, String firmKey) {
                return Result.error("查询数据失败："+cause.getMessage());
            }
        };
    }
}
