diff --git a/api/src/controllers/app.controller.ts b/api/src/controllers/app.controller.ts index 03f831174f..2a24f87087 100644 --- a/api/src/controllers/app.controller.ts +++ b/api/src/controllers/app.controller.ts @@ -37,6 +37,16 @@ export class AppController { return await this.appService.healthCheck(); } + @Get('teapot') + @ApiOperation({ + summary: 'Tip me over and pour me out', + operationId: 'teapot', + }) + @ApiOkResponse({ type: SuccessDTO }) + async teapot(): Promise { + return await this.appService.teapot(); + } + @Put('clearTempFiles') @ApiOperation({ summary: 'Trigger the removal of CSVs job', diff --git a/api/src/services/app.service.ts b/api/src/services/app.service.ts index 9967792196..2abb439531 100644 --- a/api/src/services/app.service.ts +++ b/api/src/services/app.service.ts @@ -1,6 +1,7 @@ import fs from 'fs'; import { join } from 'path'; import { + ImATeapotException, Inject, Injectable, InternalServerErrorException, @@ -111,4 +112,16 @@ export class AppService implements OnModuleInit { }); } } + + // art pulled from: https://www.asciiart.eu/food-and-drinks/coffee-and-tea + async teapot(): Promise { + throw new ImATeapotException(` + ;,' + _o_ ;:;' + ,-.'---\`.__ ; + ((j\`=====',-' + \`-\ / + \`-=-' hjw + `); + } } diff --git a/shared-helpers/src/types/backend-swagger.ts b/shared-helpers/src/types/backend-swagger.ts index 1df662c134..e404db1961 100644 --- a/shared-helpers/src/types/backend-swagger.ts +++ b/shared-helpers/src/types/backend-swagger.ts @@ -117,6 +117,20 @@ export class RootService { axios(configs, resolve, reject) }) } + /** + * Tip me over and pour me out + */ + teapot(options: IRequestOptions = {}): Promise { + return new Promise((resolve, reject) => { + let url = basePath + "/teapot" + + const configs: IRequestConfig = getConfigs("get", "application/json", url, options) + + /** 适配ios13,get请求不允许带body */ + + axios(configs, resolve, reject) + }) + } /** * Trigger the removal of CSVs job */