import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { UserDetailComponent } from './component/user-detail/user-detail.component';
import { UserListComponent } from './component/user-list/user-list.component';
import { UserConnectComponent } from './component/user-connect/user-connect.component';
import { UserRegistComponent } from './component/user-regist/user-regist.component';
import { UserFeesComponent } from './component/user-fees/user-fees.component';
import { UserAttendanceComponent } from './component/user-attendance/user-attendance.component';
import { DetailResolver } from './resolver/detail.resolver';

const routes: Routes = [

  {
    path: 'list',
    component: UserListComponent,
  },
  {
    path: 'list/:id',
    component: UserDetailComponent,
    resolve: {
      user: DetailResolver
    }
  },
  {
    path: 'connect',
    component: UserConnectComponent
  },
  {
    path: 'regist',
    component: UserRegistComponent
  },
  {
    path: 'fees',
    component: UserFeesComponent
  }
  ,
  {
    path: 'attendance',
    component: UserAttendanceComponent
  }
];

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