Class GeneralAPIController<T, ModelType>

class: APIController

  • support basic CRUD with TypedManager

Type Parameters

Hierarchy

Constructors

Properties

NS: string
TYPE: string

resource type of this Controller.

the base controller to bypass.

deleteBase: NextHandler<any, any, any> = ...

delete (or destroy) node

getBase: NextHandler<any, any, any> = ...

read node

listBase: NextHandler<any, any, any> = ...

search node

postBase: NextHandler<any, any, any> = ...

save (or create) node.

putBase: NextHandler<any, any, any> = ...

update node.

  • throw error if not found.
storage: T
unique: UniqueFieldManager<CoreModel<ModelType>, ModelType>

Methods

  • translate to camel styled function name like doGetHello()

    ex: GET / -> doList ex: GET /0/hi -> doGetHi ex: POST /0/say-me -> doPostSayMe

    Parameters

    • mode: string
    • Optional type: string
    • Optional cmd: string

    Returns string

Generated using TypeDoc