| 32 | @Route('MethodTest') |
| 33 | @Tags('MethodTest') |
| 34 | export class MethodController extends Controller { |
| 35 | @Options('Options') |
| 36 | public async optionsMethod(): Promise<TestModel> { |
| 37 | return new ModelService().getModel(); |
| 38 | } |
| 39 | |
| 40 | @Get('Get') |
| 41 | public async getMethod(): Promise<RenamedModel> { |
| 42 | return new ModelService().getModel(); |
| 43 | } |
| 44 | |
| 45 | @Post('Post') |
| 46 | public async postMethod(): Promise<TestModel> { |
| 47 | return new ModelService().getModel(); |
| 48 | } |
| 49 | |
| 50 | @Patch('Patch') |
| 51 | public async patchMethod(): Promise<TestModel> { |
| 52 | return new ModelService().getModel(); |
| 53 | } |
| 54 | |
| 55 | @Put('Put') |
| 56 | public async putMethod(): Promise<TestModel> { |
| 57 | return new ModelService().getModel(); |
| 58 | } |
| 59 | |
| 60 | @Delete('Delete') |
| 61 | public async deleteMethod(): Promise<TestModel> { |
| 62 | return new ModelService().getModel(); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * method description |
| 67 | */ |
| 68 | @Get('Description') |
| 69 | public async description(): Promise<TestModel> { |
| 70 | return new ModelService().getModel(); |
| 71 | } |
| 72 | |
| 73 | @Tags('Tag1', 'Tag2', 'Tag3') |
| 74 | @Get('Tags') |
| 75 | public async tags(): Promise<TestModel> { |
| 76 | return new ModelService().getModel(); |
| 77 | } |
| 78 | |
| 79 | @Response<ErrorResponseModel>('400', 'Bad Request', { status: 400, message: 'reason 1' }) |
| 80 | @Response<ErrorResponseModel>('400', 'Bad Request', { status: 400, message: 'reason 2' }) |
| 81 | @Response<ErrorResponseModel>('401', 'Unauthorized') |
| 82 | @Response<ErrorResponseModel>('default', 'Unexpected error', { status: 500, message: 'Something went wrong!' }) |
| 83 | @Get('MultiResponse') |
| 84 | public async multiResponse(): Promise<TestModel> { |
| 85 | return new ModelService().getModel(); |
| 86 | } |
| 87 | |
| 88 | @Tags(TEST_ENUM.TAG) |
| 89 | @Security(TEST_ENUM.SECURITY, [TEST_ENUM.ADMIN, TEST_ENUM.OWNER]) |
| 90 | @Security(TEST_SEC) |
| 91 | @Response<ErrorResponseModel>(TEST_OBJECT_CONST.unAuthCode, TEST_OBJECT_CONST.unAuthText) |
nothing calls this directly
no test coverage detected