import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MeComponent } from './me/me.component';
import { CommunityComponent } from './community/community.component';
import { ScienceDetailComponent } from './science-detail/science-detail.component';
import { ShareComponent } from './share/share.component';
import { AttentionDetailComponent } from './attention-detail/attention-detail.component';
import { RecommendDetailComponent } from './recommend-detail/recommend-detail.component';
import { UserFollowComponent } from './user-follow/user-follow.component';
import { UserTagComponent } from './user-tag/user-tag.component';
import { UserCollectionComponent } from './user-collection/user-collection.component';
import { PageChatComponent } from './page-chat/page-chat.component';
import { authGuard } from '../user/guard-auth/auth.guard';
import { PageLessonComponent } from './page-lesson/page-lesson.component';
import { PageLessonDetailComponent } from './page-lesson-detail/page-lesson-detail.component';
import { PageTestComponent } from './page-test/page-test.component';
import { ContactListPage } from './contact-list/contact-list.component';
import { ContactDetailPage } from './contact-detail/contact-detail.component';


const routes: Routes = [
  { path: 'me', component: MeComponent},
  { path: 'community', component: CommunityComponent },
  { path: 'lesson', component: PageLessonComponent, canActivate: [authGuard] },
  { path: 'lesson/detail', component: PageLessonDetailComponent },
  { path: 'page-chat', component: PageChatComponent , canActivate: [authGuard]},
  { path: 'page-test', component: PageTestComponent, canActivate: [authGuard] }, 
  { path: 'community/scienceDetail', component: ScienceDetailComponent },
  { path: 'community/attentionDetail', component: AttentionDetailComponent },
  { path: 'community/recommendDetail', component: RecommendDetailComponent },
  { path: 'community/share', component: ShareComponent },
  { path: "me/userFollow", component: ContactListPage },
  { path: "me/userTag", component: UserTagComponent },
  { path: "me/userCollection", component: UserCollectionComponent },
  { path: 'me/userFollow/list', component: ContactDetailPage},
  { path: 'me/userFollow/detail/:id', component: ContactDetailPage },


];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class LessonRoutingModule { }
