controller
This commit is contained in:
parent
0c5257d06d
commit
a86d012adc
@ -9,11 +9,13 @@ import User from './entity/user';
|
|||||||
import { TechModule } from './apps/tech';
|
import { TechModule } from './apps/tech';
|
||||||
import { CatsModule } from './apps/tech/cats/cats.module';
|
import { CatsModule } from './apps/tech/cats/cats.module';
|
||||||
import { RateModule } from './apps/rate';
|
import { RateModule } from './apps/rate';
|
||||||
|
import { UseControllerModule } from './apps/useController';
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
TechModule,
|
TechModule,
|
||||||
RateModule,
|
RateModule,
|
||||||
RateLimiterModule,
|
RateLimiterModule,
|
||||||
|
UseControllerModule,
|
||||||
ScheduleModule.forRoot(),
|
ScheduleModule.forRoot(),
|
||||||
TypeOrmModule.forRoot({
|
TypeOrmModule.forRoot({
|
||||||
type: 'mysql',
|
type: 'mysql',
|
||||||
@ -25,7 +27,7 @@ import { RateModule } from './apps/rate';
|
|||||||
entities: [User],
|
entities: [User],
|
||||||
synchronize: true, // 是否开启同步
|
synchronize: true, // 是否开启同步
|
||||||
autoLoadEntities: true, // 是否自动导入
|
autoLoadEntities: true, // 是否自动导入
|
||||||
logging: true, // 打印日志
|
logging: false, // 打印日志
|
||||||
}),
|
}),
|
||||||
CatsModule,
|
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