-
Notifications
You must be signed in to change notification settings - Fork 0
Help
Daviel edited this page May 3, 2020
·
1 revision
Todos los controladores tienen su URL de help. La url tendrá la siguiente estructura.
/help/controllername Ejemplo: /help/user
Esto retornará una entidad con la siguiente estructura:
export interface DocEntity {
controller: string;
url: string;
method: string;
description: string;
fields: DocFieldsEntity[]
}
export interface DocFieldsEntity {
field: string;
require: boolean;
type: string;
description: string | any;
}
Respuesta de ejemplo del controlador user:
[
{
"controller": "User",
"url": "/register",
"method": "POST",
"description": "Create new user",
"fields": [
{
"field": "id",
"require": false,
"type": "number",
"description": "Auto numeric number. it's not necesary to create"
},
{
"field": "email",
"require": true,
"type": "string",
"description": "Email of client"
},
{
"field": "password",
"require": true,
"type": "string",
"description": "Password top secret of client"
},
{
"field": "name",
"require": false,
"type": "string",
"description": "Name of client"
},
{
"field": "permissions",
"require": false,
"type": "number",
"description": "Id of permission of client. By default is 0"
}
]
},
{
"controller": "User",
"url": "/user/login",
"method": "POST",
"description": "Method to autenticate user. This return JWT when login is true",
"fields": [
{
"field": "email",
"require": true,
"type": "string",
"description": "Email of client"
},
{
"field": "password",
"require": true,
"type": "string",
"description": "Password top secret of client"
}
]
}
]