跳到内容

tsoa-next / @tsoa-next/runtime / ExpressTemplateService

类: 快取服务

定义如下: packages/runtime/src/routeGeneration/templates/express/expressTemplateService.ts:37

Express- 具体执行生成的路由模板服务合同。

扩展

  • TemplateService<ExpressApiHandlerParameters, ExpressValidationArgsParameters, ExpressReturnHandlerParameters>

构造器

构造器

ts
new ExpressTemplateService(models, config): ExpressTemplateService;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:12

参数

models

Models

config

AdditionalProps

回返

ExpressTemplateService

继承自

TemplateService.constructor

属性

config

ts
protected readonly config: AdditionalProps;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:14

继承自

TemplateService.config


models

ts
protected readonly models: Models;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:13

继承自

TemplateService.models


validationService

ts
protected validationService: ValidationService;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:10

继承自

TemplateService.validationService

方法

apiHandler()

ts
apiHandler(params): Promise<void>;

定义如下: packages/runtime/src/routeGeneration/templates/express/expressTemplateService.ts:38

为活动的运行时间启动控制器动作 。

参数

params

ExpressApiHandlerParameters

回返

Promise<void>

覆盖

TemplateService.apiHandler


buildPromise()

ts
protected buildPromise(
   methodName, 
   controller, 
validatedArgs): Promise<unknown>;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:77

参数

methodName

string

controller

object | Controller

validatedArgs

unknown[]

回返

Promise<unknown>

继承自

TemplateService.buildPromise


getBodyProperty()

ts
protected getBodyProperty(
   body, 
   headers, 
   propertyName): unknown;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:62

参数

body

unknown

headers

Record<string, unknown>

propertyName

string

回返

unknown

继承自

TemplateService.getBodyProperty


getValidatedArgs()

ts
getValidatedArgs(params): unknown[];

定义如下: packages/runtime/src/routeGeneration/templates/express/expressTemplateService.ts:56

验证并规范从请求中提取的路由参数。

参数

params

ExpressValidationArgsParameters

回返

unknown[]

覆盖

TemplateService.getValidatedArgs


isController()

ts
protected isController(object): object is Controller;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:28

参数

object

object | Controller

回返

object is Controller

继承自

TemplateService.isController


isRecord()

ts
protected isRecord(value): value is Record<string, unknown>;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:73

参数

value

unknown

回返

value is Record<string, unknown>

继承自

TemplateService.isRecord


normalizeRequestBody()

ts
protected normalizeRequestBody(body, headers): unknown;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:54

参数

body

unknown

headers

Record<string, unknown>

回返

unknown

继承自

TemplateService.normalizeRequestBody


requestHasBody()

ts
protected requestHasBody(headers): boolean;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:32

参数

headers

Record<string, unknown>

回返

boolean

继承自

TemplateService.requestHasBody


requestUsesTransferEncoding()

ts
protected requestUsesTransferEncoding(headers): boolean;

定义如下: packages/runtime/src/routeGeneration/templates/templateService.ts:50

参数

headers

Record<string, unknown>

回返

boolean

继承自

TemplateService.requestUsesTransferEncoding


returnHandler()

ts
protected returnHandler(params): void;

定义如下: packages/runtime/src/routeGeneration/templates/express/expressTemplateService.ts:126

写入控制器返回活动运行时间 。

参数

params

ExpressReturnHandlerParameters

回返

void

覆盖

TemplateService.returnHandler

贡献者

暂无相关贡献者

页面历史

暂无最近变更历史

以 TypeScript 为先的 OpenAPI 生成、路由生成与运行时验证。