import type { RouteRecordRaw } from 'vue-router'

const Layout = () => import('@/layouts/index.vue')

const routes: RouteRecordRaw[] = [
  {
    path: '/api',
    component: Layout,
    redirect: '/api/index',
    name: 'api',
    meta: {
      title: 'API管理',
      icon: 'ep:grape',
    },
    children: [
      {
        path: 'index',
        name: 'apiIndex',
        component: () => import('@/views/api/api/index.vue'),
        meta: {
          title: 'API接口',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/api',
        },
      },
      {
        path: 'debug/:apiId',
        name: 'apiDebug',
        component: () => import('@/views/api/debug/index.vue'),
        meta: {
          title: 'Api调试',
          sidebar: false,
          activeMenu: '/api',
          cache: true,
          noCache: 'apiDebug',
        },
      },
    ],
  },
  {
    path: '/api/log',
    component: Layout,
    redirect: '/api/log/index',
    name: 'apiLog',
    meta: {
      title: 'API日志',
      icon: 'ep:hot-water',
    },
    children: [
      {
        path: 'index',
        name: 'apiLogIndex',
        component: () => import('@/views/api/log/index.vue'),
        meta: {
          title: 'API日志',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/api/log',
        },
      },
    ],
  },
]
export default routes
