报错找不到这个类(托底类)
/**
* 日志服务降级处理
*
* @author ruoyi
*/
@Component
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService>
{
private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class);
@Override
public RemoteLogService create(Throwable throwable)
{
log.error("日志服务调用失败:{}", throwable.getMessage());
return new RemoteLogService()
{
@Override
public R<Boolean> saveLog(SysOperLog sysOperLog)
{
return null;
}
@Override
public R<Boolean> saveLogininfor(String username, String status, String message)
{
return null;
}
};
}
}
微服务之间是通过Fegin进行调用,创建了API接口,供其他模块调用,如果API接口开启了熔断机制,分类服务就无法进行启动,显示找不到托底函数。需要在分类服务启动类上指定包名,
@SpringBootApplication(scanBasePackages = “com.ruoyi”)
@EnableRyFeignClients
@SpringBootApplication(scanBasePackages = "com.ruoyi")
public class RuoYiAuthApplication
{
public static void main(String[] args)
{
SpringApplication.run(RuoYiAuthApplication.class, args);
}
}