Revert "ラフスケッチを元に新規APIをNestJS上で実装する"
This reverts commit 12cd9c5a035efa493d4e85fd7ed6f696da8dc520.
This commit is contained in:
parent
dac315c8cb
commit
94ab0e5b0d
@ -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,
|
||||
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
@ -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 {};
|
||||
}
|
||||
}
|
||||
@ -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 {}
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
@ -1,4 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class LicensesService {}
|
||||
@ -1,11 +0,0 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CreateOrdersRequest {
|
||||
@ApiProperty()
|
||||
poNumber: string;
|
||||
|
||||
@ApiProperty()
|
||||
orderCount: number;
|
||||
}
|
||||
|
||||
export class CreateOrdersResponse {}
|
||||
Loading…
x
Reference in New Issue
Block a user