Slide 21
Slide 21 text
バックエンド
コントローラを記述
import express from 'express';
import { Controller , Get, OperationId , Body, Request, Route,
Security } from 'tsoa';
@Route('user')
export class UserController extends Controller {
constructor (private service: IUserService) { super();}
/**
* ユーザ一覧取得
*/
@Get('list')
@Security(SECURITIES.COGNITO)
@OperationId ('list-user' )
public async get(
@Request() request: express.Request,
@Body() params: InputDto
): Promise {
const res = await this .service.list(
request. user, apiDtoConverter(params)
);
return apiDtoConverters.user.list.serviceToOutput (res);
}
}
Controller
後続の処理
変換
HTTP Request