user导出,auth导入,这样auth服务能用user服务;auth控制器使用auth服务
This commit is contained in:
parent
d29bbc16ba
commit
f8977de53d
|
@ -1,4 +1,9 @@
|
|||
import { Controller } from '@nestjs/common';
|
||||
import { AuthService } from './auth.service';
|
||||
|
||||
@Controller('auth')
|
||||
export class AuthController {}
|
||||
export class AuthController {
|
||||
constructor(
|
||||
private readonly authService: AuthService,
|
||||
) { }
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { AuthController } from './auth.controller';
|
||||
import { AuthService } from './auth.service';
|
||||
import { UserModule } from '../user/user.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
UserModule,
|
||||
],
|
||||
controllers: [AuthController],
|
||||
providers: [AuthService]
|
||||
})
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { UserService } from '../user/user.service';
|
||||
|
||||
@Injectable()
|
||||
export class AuthService {}
|
||||
export class AuthService {
|
||||
constructor(
|
||||
private readonly userService: UserService,
|
||||
) {}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import { User } from './user.entity';
|
|||
TypeOrmModule.forFeature([User]),
|
||||
],
|
||||
controllers: [UserController],
|
||||
providers: [UserService]
|
||||
providers: [UserService],
|
||||
exports: [UserService]
|
||||
})
|
||||
export class UserModule {}
|
||||
|
|
Loading…
Reference in New Issue