package com.yuchen.saas.manage.system.api.feign;

import com.yuchen.saas.manage.system.api.vo.RoleScopeVO;
import com.yuchen.saas.manage.system.api.vo.RoleV1BusinessScopeVO;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/25 10:08
 * @Description: 
 * @Version: 1.0
 */
@Component
public class RoleV1FeignFallback implements FallbackFactory<RoleV1FeignServer> {

    @Override
    public RoleV1FeignServer create(Throwable cause) {
        return new RoleV1FeignServer() {
            @Override
            public R<List<RoleScopeVO>> listByIds(Long userId, Long deptId,Integer isAdmin) {
                return R.error("远程调用失败");
            }

            @Override
            public R<RoleV1BusinessScopeVO> getBusinessScopeList(Long orgUserId, Long deptId, Integer type) {
                return R.error("远程调用失败");
            }


        };
    }
}