From 174abf099077bd34535957f2bfb84cadd7a53ab3 Mon Sep 17 00:00:00 2001 From: Santiago Gaona <53282017+SantiagoGaonaC@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:00:50 -0500 Subject: [PATCH 1/4] feat: update ServiceReference WSDL (#35) --- ServiceReference/Reference.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ServiceReference/Reference.cs b/ServiceReference/Reference.cs index ddccf15..af9c238 100644 --- a/ServiceReference/Reference.cs +++ b/ServiceReference/Reference.cs @@ -1930,21 +1930,16 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration)); } - + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) { if ((endpointConfiguration == EndpointConfiguration.ServiceImpPort)) { - string serviceUrl = Environment.GetEnvironmentVariable("SERVICE_URL"); - if (string.IsNullOrEmpty(serviceUrl)) - { - throw new ApplicationException("SERVICE_URL env not found!"); - } - return new System.ServiceModel.EndpointAddress(serviceUrl); + return new System.ServiceModel.EndpointAddress("http://localhost:8080/gw/service"); } throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration)); } - + private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return ServiceClient.GetBindingForEndpoint(EndpointConfiguration.ServiceImpPort); From 158d7710dfc0dbbf97c9fd5df675401195402d59 Mon Sep 17 00:00:00 2001 From: Santiago Gaona <53282017+SantiagoGaonaC@users.noreply.github.com> Date: Thu, 19 Oct 2023 23:07:18 -0500 Subject: [PATCH 2/4] docs(openApi): share file with who update Docs ShareFileWitho) --- Docs/openapi.json | 110 +++++++++++++++++++++++++++++++++- ServiceReference/Reference.cs | 11 +++- 2 files changed, 116 insertions(+), 5 deletions(-) diff --git a/Docs/openapi.json b/Docs/openapi.json index aac6383..7b16409 100644 --- a/Docs/openapi.json +++ b/Docs/openapi.json @@ -804,7 +804,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"directoryName\": \"MyNewDirectory2\",\r\n \"location\": \"MyNewDirectory\",\r\n \"token\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDAwMDcyMTcsInV1aWQiOiI3YzE0ZmRlZC1hY2YxLTQzNjQtOWYwZi02MDY1MzNjMDA0MDMifQ.gUzM2goE7rBMEurL900gsiWRMB7WNdC5Q2um7udev3C_ZjXuB0V1gwcRLUj3AHr1CPf5KdZfSS1L7gZ94qOTlA\"\r\n}", + "raw": "{\r\n \"directoryName\": \"Halloween\",\r\n //\"location\": \"bc4351fe-a731-4c21-8120-6c4f8841a461\",\r\n \"token\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDAzNjQ5MzUsInV1aWQiOiJhM2Y0OWU2MC01NGUwLTQxNWEtOTc4Zi0wNmY5ZGM0OTI0YmQifQ.9rnDCpIyBq-PhVD2rBfP_BUjip3WO3UBhM2mZs5XJq7g-fjmDtJQw_Cc2UVkCGCi3tIwhbWDbm7GM_HNf6EWLw\"\r\n}", "options": { "raw": { "language": "json" @@ -1645,7 +1645,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"location\": \"b1f24376-b49b-4602-b2a8-86746086a456\",\r\n \"token\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDAwMDcyMTcsInV1aWQiOiI3YzE0ZmRlZC1hY2YxLTQzNjQtOWYwZi02MDY1MzNjMDA0MDMifQ.gUzM2goE7rBMEurL900gsiWRMB7WNdC5Q2um7udev3C_ZjXuB0V1gwcRLUj3AHr1CPf5KdZfSS1L7gZ94qOTlA\"\r\n}", + "raw": "{\r\n \"location\": \"null\",\r\n \"token\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDAwMDcyMTcsInV1aWQiOiI3YzE0ZmRlZC1hY2YxLTQzNjQtOWYwZi02MDY1MzNjMDA0MDMifQ.gUzM2goE7rBMEurL900gsiWRMB7WNdC5Q2um7udev3C_ZjXuB0V1gwcRLUj3AHr1CPf5KdZfSS1L7gZ94qOTlA\"\r\n}", "options": { "raw": { "language": "json" @@ -2349,6 +2349,112 @@ ], "cookie": [], "body": "Excepción no controlada" + }, + { + "name": "200 OK NULL", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"fileUUID\": \"8e91fea4-2855-48eb-a8dd-f734b8e50e4b\",\r\n \"token\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDAzNjY1NTIsInV1aWQiOiI5OTc0Y2M2Yy03OGQwLTRjOTAtOTBmOC00OTFkMjZkYjNlYTIifQ.Fug1w1lV52NyNMG97qF4bB2a2BR5uwJQCF9rLk7wHlahTAtZ9tqoqgyTl5Ng_YRfXR5P_bZs5YAFpUPXr8hrfw\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8084/share/list/with/who", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8084", + "path": [ + "share", + "list", + "with", + "who" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Length", + "value": "65" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Date", + "value": "Fri, 20 Oct 2023 04:04:52 GMT" + }, + { + "key": "Server", + "value": "Kestrel" + } + ], + "cookie": [], + "body": "{\n \"usernames\": null,\n \"msg\": \"List of shared with users successfully\"\n}" + }, + { + "name": "/share/list/with/who", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"fileUUID\": \"8e91fea4-2855-48eb-a8dd-f734b8e50e4b\",\r\n \"token\": \"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDAzNjY1NTIsInV1aWQiOiI5OTc0Y2M2Yy03OGQwLTRjOTAtOTBmOC00OTFkMjZkYjNlYTIifQ.Fug1w1lV52NyNMG97qF4bB2a2BR5uwJQCF9rLk7wHlahTAtZ9tqoqgyTl5Ng_YRfXR5P_bZs5YAFpUPXr8hrfw\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8084/share/list/with/who", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8084", + "path": [ + "share", + "list", + "with", + "who" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Length", + "value": "74" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Date", + "value": "Fri, 20 Oct 2023 04:05:46 GMT" + }, + { + "key": "Server", + "value": "Kestrel" + } + ], + "cookie": [], + "body": "{\n \"usernames\": [\n \"usernamee\"\n ],\n \"msg\": \"List of shared with users successfully\"\n}" } ] } diff --git a/ServiceReference/Reference.cs b/ServiceReference/Reference.cs index af9c238..ddccf15 100644 --- a/ServiceReference/Reference.cs +++ b/ServiceReference/Reference.cs @@ -1930,16 +1930,21 @@ private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(Endpoi } throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration)); } - + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) { if ((endpointConfiguration == EndpointConfiguration.ServiceImpPort)) { - return new System.ServiceModel.EndpointAddress("http://localhost:8080/gw/service"); + string serviceUrl = Environment.GetEnvironmentVariable("SERVICE_URL"); + if (string.IsNullOrEmpty(serviceUrl)) + { + throw new ApplicationException("SERVICE_URL env not found!"); + } + return new System.ServiceModel.EndpointAddress(serviceUrl); } throw new System.InvalidOperationException(string.Format("No se pudo encontrar un punto de conexión con el nombre \"{0}\".", endpointConfiguration)); } - + private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return ServiceClient.GetBindingForEndpoint(EndpointConfiguration.ServiceImpPort); From a4d033c3a819636b26a6ec73822ca9e6b29f1fce Mon Sep 17 00:00:00 2001 From: Santiago Gaona <53282017+SantiagoGaonaC@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:37:50 -0500 Subject: [PATCH 3/4] feat: update ServiceReferences --- ServiceReference/Reference.cs | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/ServiceReference/Reference.cs b/ServiceReference/Reference.cs index ddccf15..57f511d 100644 --- a/ServiceReference/Reference.cs +++ b/ServiceReference/Reference.cs @@ -527,7 +527,6 @@ public string location } /// - [System.Xml.Serialization.XmlIncludeAttribute(typeof(sharedFile))] [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://soap.gateway/")] @@ -615,30 +614,6 @@ public int size } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://soap.gateway/")] - public partial class sharedFile : file - { - - private string ownerUsernameField; - - /// - [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] - public string ownerUsername - { - get - { - return this.ownerUsernameField; - } - set - { - this.ownerUsernameField = value; - } - } - } - /// [System.Xml.Serialization.XmlIncludeAttribute(typeof(resShareListWithWho))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(resFileGet))] @@ -758,11 +733,11 @@ public file file public partial class resShareList : resStatus { - private sharedFile[] sharedFilesField; + private file[] sharedFilesField; /// [System.Xml.Serialization.XmlElementAttribute("sharedFiles", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true, Order=0)] - public sharedFile[] sharedFiles + public file[] sharedFiles { get { From 7fc3006c23b37a203e08ed62a5da2da6384e2ef0 Mon Sep 17 00:00:00 2001 From: Santiago Gaona <53282017+SantiagoGaonaC@users.noreply.github.com> Date: Sat, 21 Oct 2023 16:36:45 -0500 Subject: [PATCH 4/4] refactor: change validation request FileMove --- Controllers/File/FileMoveController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Controllers/File/FileMoveController.cs b/Controllers/File/FileMoveController.cs index fdbfed3..dccd73f 100644 --- a/Controllers/File/FileMoveController.cs +++ b/Controllers/File/FileMoveController.cs @@ -24,8 +24,7 @@ public FileMoveController(ILogger logger, IFileRepository fi public async Task Pust([FromBody] reqFileMove reqFileMove) { if (reqFileMove == null || string.IsNullOrEmpty(reqFileMove.fileUUID) - || string.IsNullOrEmpty(reqFileMove.token) - || string.IsNullOrEmpty(reqFileMove.targetDirectoryUUID)) + || string.IsNullOrEmpty(reqFileMove.token)) { return BadRequest(new ResponseError {