controller
This commit is contained in:
parent
0c5257d06d
commit
a86d012adc
@ -77,4 +77,4 @@
|
||||
"coverageDirectory": "../coverage",
|
||||
"testEnvironment": "node"
|
||||
}
|
||||
}
|
||||
}
|
@ -9,11 +9,13 @@ import User from './entity/user';
|
||||
import { TechModule } from './apps/tech';
|
||||
import { CatsModule } from './apps/tech/cats/cats.module';
|
||||
import { RateModule } from './apps/rate';
|
||||
import { UseControllerModule } from './apps/useController';
|
||||
@Module({
|
||||
imports: [
|
||||
TechModule,
|
||||
RateModule,
|
||||
RateLimiterModule,
|
||||
UseControllerModule,
|
||||
ScheduleModule.forRoot(),
|
||||
TypeOrmModule.forRoot({
|
||||
type: 'mysql',
|
||||
@ -25,7 +27,7 @@ import { RateModule } from './apps/rate';
|
||||
entities: [User],
|
||||
synchronize: true, // 是否开启同步
|
||||
autoLoadEntities: true, // 是否自动导入
|
||||
logging: true, // 打印日志
|
||||
logging: false, // 打印日志
|
||||
}),
|
||||
CatsModule,
|
||||
],
|
||||
|
8
src/apps/useController/index.ts
Normal file
8
src/apps/useController/index.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import ParamController from './param';
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [ParamController],
|
||||
providers: [],
|
||||
})
|
||||
export class UseControllerModule {}
|
12
src/apps/useController/param.ts
Normal file
12
src/apps/useController/param.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('/useController/param')
|
||||
@ApiTags('Controller使用')
|
||||
export default class ParamController {
|
||||
// 基本控制器
|
||||
@Get('/t1')
|
||||
getT1() {
|
||||
return 'T1';
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user