chore: updated route

This commit is contained in:
Methapon2001 2023-11-20 14:13:26 +07:00
parent 627567abf6
commit 44259437f6
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
2 changed files with 144 additions and 26 deletions

View file

@ -291,7 +291,6 @@ export function RegisterRoutes(app: Router) {
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(FileController)),
...(fetchMiddlewares<RequestHandler>(FileController.prototype.getFile)),
@ -318,6 +317,42 @@ export function RegisterRoutes(app: Router) {
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.patch('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file/:fileName',
authenticateMiddleware([{"bearerAuth":[]}]),
upload.single('file'),
...(fetchMiddlewares<RequestHandler>(FileController)),
...(fetchMiddlewares<RequestHandler>(FileController.prototype.updateFile)),
function FileController_updateFile(request: any, response: any, next: any) {
const args = {
request: {"in":"request","name":"request","required":true,"dataType":"object"},
cabinetName: {"in":"path","name":"cabinetName","required":true,"dataType":"string"},
drawerName: {"in":"path","name":"drawerName","required":true,"dataType":"string"},
folderName: {"in":"path","name":"folderName","required":true,"dataType":"string"},
fileName: {"in":"path","name":"fileName","required":true,"dataType":"string"},
file: {"in":"formData","name":"file","dataType":"file"},
title: {"in":"formData","name":"title","dataType":"string"},
description: {"in":"formData","name":"description","dataType":"string"},
keyword: {"in":"formData","name":"keyword","dataType":"string"},
category: {"in":"formData","name":"category","dataType":"string"},
};
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = getValidatedArgs(args, request, response);
const controller = new FileController();
const promise = controller.updateFile.apply(controller, validatedArgs as any);
promiseHandler(controller, promise, response, 200, next);
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.delete('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file/:fileName',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(FileController)),

View file

@ -463,20 +463,6 @@
"schema": {
"items": {
"properties": {
"updatedBy": {
"type": "string"
},
"updatedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"format": "date-time"
}
]
},
"createdBy": {
"type": "string"
},
@ -491,16 +477,27 @@
}
]
},
"type": {
"updatedBy": {
"type": "string"
},
"category": {
"updatedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"format": "date-time"
}
]
},
"keyword": {
"items": {
"type": "string"
},
"type": "array"
},
"keyword": {
"category": {
"items": {
"type": "string"
},
@ -512,20 +509,32 @@
"title": {
"type": "string"
},
"fileType": {
"type": "string"
},
"fileSize": {
"type": "number",
"format": "double"
},
"fileName": {
"type": "string"
},
"pathname": {
"type": "string"
}
},
"required": [
"updatedBy",
"updatedAt",
"createdBy",
"createdAt",
"type",
"category",
"updatedBy",
"updatedAt",
"keyword",
"category",
"description",
"title",
"fileType",
"fileSize",
"fileName",
"pathname"
],
"type": "object"
@ -539,6 +548,46 @@
"tags": [
"File"
],
"security": [],
"parameters": [
{
"in": "path",
"name": "cabinetName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "drawerName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "folderName",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}": {
"patch": {
"operationId": "UpdateFile",
"responses": {
"200": {
"description": ""
}
},
"tags": [
"File"
],
"security": [
{
"bearerAuth": []
@ -568,11 +617,45 @@
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "fileName",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}": {
],
"requestBody": {
"required": false,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"keyword": {
"type": "string"
},
"category": {
"type": "string"
}
}
}
}
}
}
},
"delete": {
"operationId": "DeleteFile",
"responses": {