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 { 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 }; } }