Revert "ラフスケッチを元に新規APIをNestJS上で実装する"

This reverts commit 12cd9c5a035efa493d4e85fd7ed6f696da8dc520.
This commit is contained in:
iwata 2023-05-11 13:54:35 +09:00
parent dac315c8cb
commit 94ab0e5b0d
7 changed files with 0 additions and 111 deletions

View File

@ -28,7 +28,6 @@ import { FilesService } from './features/files/files.service';
import { TasksService } from './features/tasks/tasks.service';
import { TasksController } from './features/tasks/tasks.controller';
import { TasksModule } from './features/tasks/tasks.module';
import { LicensesModule } from './features/licenses/licenses.module';
@Module({
imports: [
@ -66,7 +65,6 @@ import { LicensesModule } from './features/licenses/licenses.module';
}),
NotificationModule,
NotificationhubModule,
LicensesModule,
],
controllers: [
HealthController,

View File

@ -1,18 +0,0 @@
import { Test, TestingModule } from '@nestjs/testing';
import { LicensesController } from './licenses.controller';
describe('LicensesController', () => {
let controller: LicensesController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [LicensesController],
}).compile();
controller = module.get<LicensesController>(LicensesController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@ -1,49 +0,0 @@
import { Body, Controller, HttpStatus, Post, Req } from '@nestjs/common';
import {
ApiResponse,
ApiTags,
ApiOperation,
ApiBearerAuth,
} from '@nestjs/swagger';
import { ErrorResponse } from '../../common/error/types/types';
import { LicensesService } from './licenses.service';
import { CreateOrdersResponse, CreateOrdersRequest } from './types/types';
import { Request } from 'express';
@ApiTags('licenses')
@Controller('licenses')
export class LicensesController {
constructor(private readonly licensesService: LicensesService) {}
@ApiResponse({
status: HttpStatus.OK,
type: CreateOrdersResponse,
description: '成功時のレスポンス',
})
@ApiResponse({
status: HttpStatus.BAD_REQUEST,
description: '同一PONumberの注文がすでに存在する場合など',
type: ErrorResponse,
})
@ApiResponse({
status: HttpStatus.UNAUTHORIZED,
description: '認証エラー',
type: ErrorResponse,
})
@ApiResponse({
status: HttpStatus.INTERNAL_SERVER_ERROR,
description: '想定外のサーバーエラー',
type: ErrorResponse,
})
@ApiOperation({ operationId: 'signup' })
@ApiBearerAuth()
@Post('/orders')
async createOrders(
@Req() req: Request,
@Body() body: CreateOrdersRequest,
): Promise<CreateOrdersResponse> {
console.log(req.header('Authorization'));
console.log(body);
return {};
}
}

View File

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { LicensesController } from './licenses.controller';
import { LicensesService } from './licenses.service';
@Module({
controllers: [LicensesController],
providers: [LicensesService],
})
export class LicensesModule {}

View File

@ -1,18 +0,0 @@
import { Test, TestingModule } from '@nestjs/testing';
import { LicensesService } from './licenses.service';
describe('LicensesService', () => {
let service: LicensesService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [LicensesService],
}).compile();
service = module.get<LicensesService>(LicensesService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@ -1,4 +0,0 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class LicensesService {}

View File

@ -1,11 +0,0 @@
import { ApiProperty } from '@nestjs/swagger';
export class CreateOrdersRequest {
@ApiProperty()
poNumber: string;
@ApiProperty()
orderCount: number;
}
export class CreateOrdersResponse {}