import { Controller, HttpException, HttpStatus, Logger, Post, Req, } from "@nestjs/common"; import { ErrorResponse } from "../../common/errors/types/types"; import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger"; import { Request } from "express"; import { DeleteService } from "./delete.service"; import { DeleteResponse } from "./types/types"; import { makeContext } from "src/common/log"; @ApiTags("delete") @Controller("delete") export class DeleteController { constructor(private readonly deleteService: DeleteService) {} @ApiResponse({ status: HttpStatus.OK, type: DeleteResponse, description: "成功時のレスポンス", }) @ApiResponse({ status: HttpStatus.INTERNAL_SERVER_ERROR, description: "想定外のサーバーエラー", type: ErrorResponse, }) @ApiOperation({ operationId: "deleteData", description: "すべてのデータを削除します", }) @Post() async deleteData(): Promise<{}> { const context = makeContext("tool", "delete"); await this.deleteService.deleteData(context); return {}; } }