From d29bbc16bab462e7535f576aaec0ec2c1f8a1338 Mon Sep 17 00:00:00 2001 From: Jeremy Yin Date: Tue, 2 Jul 2019 22:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAauth=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=EF=BC=8C=E6=8E=A7=E5=88=B6=E5=99=A8=EF=BC=8C=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.module.ts | 2 ++ src/modules/auth/auth.controller.spec.ts | 18 ++++++++++++++++++ src/modules/auth/auth.controller.ts | 4 ++++ src/modules/auth/auth.module.ts | 9 +++++++++ src/modules/auth/auth.service.spec.ts | 18 ++++++++++++++++++ src/modules/auth/auth.service.ts | 4 ++++ 6 files changed, 55 insertions(+) create mode 100644 src/modules/auth/auth.controller.spec.ts create mode 100644 src/modules/auth/auth.controller.ts create mode 100644 src/modules/auth/auth.module.ts create mode 100644 src/modules/auth/auth.service.spec.ts create mode 100644 src/modules/auth/auth.service.ts diff --git a/src/app.module.ts b/src/app.module.ts index 0e2c717..c498c21 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -4,6 +4,7 @@ import { AppService } from './app.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { PostModule } from './modules/post/post.module'; import { UserModule } from './modules/user/user.module'; +import { AuthModule } from './modules/auth/auth.module'; @Module({ imports: [ @@ -19,6 +20,7 @@ import { UserModule } from './modules/user/user.module'; }), PostModule, UserModule, + AuthModule, ], controllers: [AppController], providers: [AppService], diff --git a/src/modules/auth/auth.controller.spec.ts b/src/modules/auth/auth.controller.spec.ts new file mode 100644 index 0000000..5695209 --- /dev/null +++ b/src/modules/auth/auth.controller.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AuthController } from './auth.controller'; + +describe('Auth Controller', () => { + let controller: AuthController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [AuthController], + }).compile(); + + controller = module.get(AuthController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts new file mode 100644 index 0000000..268eeb2 --- /dev/null +++ b/src/modules/auth/auth.controller.ts @@ -0,0 +1,4 @@ +import { Controller } from '@nestjs/common'; + +@Controller('auth') +export class AuthController {} diff --git a/src/modules/auth/auth.module.ts b/src/modules/auth/auth.module.ts new file mode 100644 index 0000000..b51ac54 --- /dev/null +++ b/src/modules/auth/auth.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { AuthController } from './auth.controller'; +import { AuthService } from './auth.service'; + +@Module({ + controllers: [AuthController], + providers: [AuthService] +}) +export class AuthModule {} diff --git a/src/modules/auth/auth.service.spec.ts b/src/modules/auth/auth.service.spec.ts new file mode 100644 index 0000000..800ab66 --- /dev/null +++ b/src/modules/auth/auth.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AuthService } from './auth.service'; + +describe('AuthService', () => { + let service: AuthService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [AuthService], + }).compile(); + + service = module.get(AuthService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts new file mode 100644 index 0000000..a41c649 --- /dev/null +++ b/src/modules/auth/auth.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class AuthService {}