Skip to content

Commit

Permalink
feat: #39 dto 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
lywg committed Dec 6, 2022
1 parent 75bc113 commit c315b34
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/report/dto/RequestCreateReportDto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ApiProperty } from "@nestjs/swagger";
import { IsNumber } from "class-validator";

export class RequestCreateReportDto {
@ApiProperty()
@IsNumber()
report_type: number;


}
18 changes: 18 additions & 0 deletions src/report/report.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ReportController } from './report.controller';

describe('ReportController', () => {
let controller: ReportController;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [ReportController],
}).compile();

controller = module.get<ReportController>(ReportController);
});

it('should be defined', () => {
expect(controller).toBeDefined();
});
});
9 changes: 9 additions & 0 deletions src/report/report.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Controller } from '@nestjs/common';
import { ReportService } from './report.service';

@Controller('report')
export class ReportController {
constructor(private reportService: ReportService) { }


}
4 changes: 4 additions & 0 deletions src/report/report.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Report } from './report.entity';
import { ReportController } from './report.controller';
import { ReportService } from './report.service';

@Module({
imports: [TypeOrmModule.forFeature([Report])],
controllers: [ReportController],
providers: [ReportService],
})
export class ReportModule {}
18 changes: 18 additions & 0 deletions src/report/report.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ReportService } from './report.service';

describe('ReportService', () => {
let service: ReportService;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [ReportService],
}).compile();

service = module.get<ReportService>(ReportService);
});

it('should be defined', () => {
expect(service).toBeDefined();
});
});
14 changes: 14 additions & 0 deletions src/report/report.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Report } from './report.entity';

@Injectable()
export class ReportService {
constructor(
@InjectRepository(Report)
private reportRepository: Repository<Report>,


) { }
}

0 comments on commit c315b34

Please sign in to comment.