新RabbitMQ精讲,项目驱动落地,分布式事务拔高
作者:互联网
download:新RabbitMQ精讲,项目驱动落地,分布式事务拔高
大部分同学的现状是:熟悉表面理论知识,却无法很好应用到工作中。我们收到这些反馈后,才诞生了本课程。 为了避免只学到死知识、不敢在生产环境实操的尴尬局面。本课从知识上也是从入门到精通,但却全程用项目递进的方式讲授知识。目标就是会用,课程中还融入了很多开发小Tips。并且把深度做足:解读核心源码,基于RabbitMQ二次开发,手写分布式事务框架,提升技术深度,培养框架思维。
适合人群
对RabbitMQ不了解的Java开发者
有RabbitMQ基础,实际使用经验有限的Java开发者
对RabbitMQ感兴趣的开发者
技术储备要求
Java语言基础、SpringBoot基础
function generateFlatRoutes(acce***outes) {
let flatRoutes = [];
for (let item of acce***outes) {
let childrenFflatRoutes = [];
if (item.children && item.children.length > 0) {
childrenFflatRoutes = castToFlatRoute(item.children, "");
}
// 一级路由是规划路由,需求处置的只是其子路由数据
flatRoutes.push({
name: item.name,
path: item.path,
component: item.component,
redirect: item.redirect,
children: childrenFflatRoutes
});
}
return flatRoutes;
}
/**
- 将子路由转换为扁平化路由数组(仅一级)
- @param {待转换的子路由数组} routes
- @param {父级路由途径} parentPath
*/
function castToFlatRoute(routes, parentPath, flatRoutes = []) {
for (let item of routes) {
if (item.children && item.children.length > 0) {
if (item.redirect && item.redirect !== 'noRedirect') {
flatRoutes.push({
name: item.name,
path: item.path,
redirect: item.redirect,
meta: item.meta
});
}
castToFlatRoute(item.children, parentPath + "/" + item.path, flatRoutes);
} else {
flatRoutes.push({
name: item.name,
path: item.path,
component: item.component,
meta: item.meta
});
}
}
return flatRoutes;
}
let lastAroutes = generateFlatRoutes(aRouter);
function generateFlatRoutes(acce***outes) {
let flatRoutes = [];
for (let item of acce***outes) {
let childrenFflatRoutes = [];
if (item.children && item.children.length > 0) {
childrenFflatRoutes = castToFlatRoute(item.children, "");
}
// 一级路由是规划路由,需求处置的只是其子路由数据
flatRoutes.push({
name: item.name,
path: item.path,
component: item.component,
redirect: item.redirect,
children: childrenFflatRoutes
});
}
return flatRoutes;
}
/**- 将子路由转换为扁平化路由数组(仅一级)
- @param {待转换的子路由数组} routes
- @param {父级路由途径} parentPath
*/
function castToFlatRoute(routes, parentPath, flatRoutes = []) {
for (let item of routes) {
if (item.children && item.children.length > 0) {
if (item.redirect && item.redirect !== 'noRedirect') {
flatRoutes.push({
name: item.name,
path: (parentPath + "/" + item.path).substring(1),
redirect: item.redirect,
meta: item.meta
});
}
castToFlatRoute(item.children, parentPath + "/" + item.path, flatRoutes);
} else {
flatRoutes.push({
name: item.name,
path: (parentPath + "/" + item.path).substring(1),
component: item.component,
meta: item.meta
});
}
}
return flatRoutes;
}
标签:redirect,拔高,精讲,RabbitMQ,flatRoutes,item,path,children,路由 来源: https://blog.51cto.com/15110735/2661275