import { Module } from '@nestjs/common';
import { LiveTeachingService } from './service/live-teaching.service';
import { LiveTeachingController } from './controller/live-teaching.controller';
import { LiveTeaching } from './entities/live-teaching.entity';
import { TypeOrmModule } from '@nestjs/typeorm';
import { LiveCourseware } from './entities/live-courseware.entity';
import { LiveQuestion } from './entities/live-question.entity';
import { LiveEvaluate } from './entities/live-evaluate.entity';
import { LiveStudent } from './entities/live-student.entity';
import { LiveClassify } from './entities/live-classify.entity';
import { LiveClassController } from './controller/live-class.controller';
import { LiveClassService } from './service/live-class.service';
import { OnlineTeachingGateway } from './gateway/online-teaching.gateway';
import { LiveMsgData } from './entities/live-msg-data.entity';
import { LiveQuestionAnswer } from './entities/live-question-answer.entity';
import { Question } from 'src/assessment-evaluation/entities/entities-question-manager/question.entity';
import { JwtAuthGuard } from 'src/system/jwt/jwt-auth.guard';
import { JwtModule } from '@nestjs/jwt';
import { APP_GUARD } from '@nestjs/core';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      LiveTeaching,
      LiveCourseware,
      LiveQuestion,
      LiveEvaluate,
      LiveStudent,
      LiveClassify,
      LiveMsgData,
      LiveQuestion,
      LiveQuestionAnswer,
      Question,
    ]),
    JwtModule.register({
      secret: 'jwtConstants.secret',
      signOptions: { expiresIn: '7d' },
    }),
  ],
  controllers: [LiveTeachingController, LiveClassController],
  providers: [
    LiveTeachingService,
    LiveClassService,
    OnlineTeachingGateway,
    {
      provide: APP_GUARD,
      useClass: JwtAuthGuard,
    },
  ],
})
export class OnlineTeachingModule {}
