## 概要 [Task3569: データ削除ツール作成+動作確認](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3569) - ADB2Cからのユーザー削除が100件ごとにしか削除できていなかったので、修正しました。 - 取得が100件まででそのユーザーに対して削除処理をしていたので100件までの削除になっていました。 - 対応として、100件づつの削除をユーザーが全削除されるまで実行するようにしました。 ## レビューポイント - 対応方法として適切でしょうか? - ループで制限を設けていますが、MAX値として適切でしょうか? ## UIの変更 - なし ## 動作確認状況 - ローカルで順に実行できることを確認 - 実際の削除は別途develop環境で実施します。
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
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 {};
|
|
}
|
|
}
|