From 3247af3cab1b6259d4ceefd729f05dac6eb75b96 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:47:10 +0700 Subject: [PATCH] chore: update route and swagger --- Prototype/server/src/routes.ts | 10 +++++ Prototype/server/src/swagger.json | 61 ++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/Prototype/server/src/routes.ts b/Prototype/server/src/routes.ts index 807727b..a028c3e 100644 --- a/Prototype/server/src/routes.ts +++ b/Prototype/server/src/routes.ts @@ -56,6 +56,15 @@ const models: TsoaRoute.Models = { "additionalProperties": false, }, // 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 + "Search": { + "dataType": "refObject", + "properties": { + "AND": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"string","required":true},"field":{"dataType":"string","required":true}}}}, + "OR": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"string","required":true},"field":{"dataType":"string","required":true}}}}, + }, + "additionalProperties": false, + }, + // 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 }; const validationService = new ValidationService(models); @@ -523,6 +532,7 @@ export function RegisterRoutes(app: Router) { function SearchController_searchFile(request: any, response: any, next: any) { const args = { + search: {"in":"body","name":"search","required":true,"ref":"Search"}, }; // 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 diff --git a/Prototype/server/src/swagger.json b/Prototype/server/src/swagger.json index ed1bf8f..7778788 100644 --- a/Prototype/server/src/swagger.json +++ b/Prototype/server/src/swagger.json @@ -124,6 +124,48 @@ ], "type": "object", "additionalProperties": false + }, + "Search": { + "properties": { + "AND": { + "items": { + "properties": { + "value": { + "type": "string" + }, + "field": { + "type": "string" + } + }, + "required": [ + "value", + "field" + ], + "type": "object" + }, + "type": "array" + }, + "OR": { + "items": { + "properties": { + "value": { + "type": "string" + }, + "field": { + "type": "string" + } + }, + "required": [ + "value", + "field" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "additionalProperties": false } }, "securitySchemes": { @@ -928,15 +970,30 @@ "content": { "application/json": { "schema": { - "items": {}, + "items": { + "$ref": "#/components/schemas/EhrFile" + }, "type": "array" } } } } }, + "tags": [ + "Search" + ], "security": [], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Search" + } + } + } + } } }, "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder": {