import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { authGuard } from 'src/modules/user/auth.guard';

const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  },

  {
    path: 'user',
    loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
  },
  {
    path:'study',
    canActivate:[authGuard],//路由守卫
    children:[
      {
          path: 'parse',
          loadChildren: () => import('../modules/study/case-parse/case-parse.module').then( m => m.CaseParsePageModule)
      },
      {
          path: 'results',
          loadChildren: () => import('../modules/study/results/results.module').then( m => m.ResultsPageModule)
      },
      {
        path: 'camera',
        loadChildren: () => import('../modules/study/camera-page/camera-page.module').then( m => m.CameraPagePageModule)
      },
    ]
  }, 
  {
    path:'aigc',
    canActivate:[authGuard],//路由守卫
    children:[
      {
          path: 'agent-shige',
          loadChildren: () => import('../modules/aigc/agent/agent-shige/agent-shige.module').then( m => m.AgentShigePageModule)
      },
      {
          path: 'chat',
          loadChildren: () => import('../modules/aigc/chat/chat.module').then( m => m.ChatPageModule)
      },
    ]
  },

  
];
@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}
