## 概要 [Task2806: API-IF実装](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2806) 以下APIのIFを実装しました。 ・アカウント情報取得(未認証時最小アクセス)API ・利用規約情報取得API ・同意済バージョン更新API またトークン生成APIのIFにコメントを追加しました。 ## レビューポイント なし ## UIの変更 なし ## 動作確認状況 swaggerUIで動作確認 ## 補足 なし
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { Controller, HttpStatus, Post } from '@nestjs/common';
|
|
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
import { TermsService } from '../terms/terms.service';
|
|
import { ErrorResponse } from '../../common/error/types/types';
|
|
import { makeContext } from '../../common/log';
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
import { GetTermsInfoResponse, TermInfo } from './types/types';
|
|
|
|
@ApiTags('terms')
|
|
@Controller('terms')
|
|
export class TermsController {
|
|
constructor(
|
|
private readonly termsService: TermsService, //private readonly cryptoService: CryptoService,
|
|
) {}
|
|
|
|
@Post()
|
|
@ApiResponse({
|
|
status: HttpStatus.OK,
|
|
type: GetTermsInfoResponse,
|
|
description: '成功時のレスポンス',
|
|
})
|
|
@ApiResponse({
|
|
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
description: '想定外のサーバーエラー',
|
|
type: ErrorResponse,
|
|
})
|
|
@ApiOperation({ operationId: 'getTermsInfo' })
|
|
async getTermsInfo(): Promise<GetTermsInfoResponse> {
|
|
const context = makeContext(uuidv4());
|
|
|
|
// TODO 仮実装。API実装タスクで本実装する。
|
|
// const termInfo = await this.termsService.getTermsInfo(context);
|
|
const termsInfo = [
|
|
{ documentType: 'EULA', version: '1.0' },
|
|
{ documentType: 'DPA', version: '1.1' },
|
|
] as TermInfo[];
|
|
|
|
return { termsInfo };
|
|
}
|
|
}
|