From 6b93f0ac3ffa2dd5869fd24def3e6c04a40fb563 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 7 Aug 2023 12:19:20 +0200 Subject: [PATCH] =?UTF-8?q?Type=20f=C3=BCr=20Participant,=20Content-Type?= =?UTF-8?q?=20in=20responses=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- misc/BreCal.postman_collection.json | 18 +++++------- misc/create_schema.sql | 1 + misc/sample_data.sql | 2 +- src/RoleEditor/MainWindow.xaml | 15 ++++++---- src/RoleEditor/MainWindow.xaml.cs | 16 ++++++++--- src/brecal.model/EnumHelper.cs | 27 ++++++++++++++++++ src/brecal.model/Participant.cs | 38 ++++++++++++++++++------- src/brecal.mysql/DBManager.cs | 2 +- src/server/BreCal/__init__.py | 1 + src/server/BreCal/api/participant.py | 6 ++-- src/server/BreCal/impl/berths.py | 4 +-- src/server/BreCal/impl/login.py | 8 +++--- src/server/BreCal/impl/notifications.py | 2 +- src/server/BreCal/impl/participant.py | 8 +++--- src/server/BreCal/impl/shipcalls.py | 12 ++++---- src/server/BreCal/impl/ships.py | 4 +-- src/server/BreCal/impl/times.py | 20 ++++++------- src/server/BreCal/schemas/model.py | 1 + 18 files changed, 120 insertions(+), 65 deletions(-) create mode 100644 src/brecal.model/EnumHelper.cs diff --git a/misc/BreCal.postman_collection.json b/misc/BreCal.postman_collection.json index 7da647a..f1ef9ad 100644 --- a/misc/BreCal.postman_collection.json +++ b/misc/BreCal.postman_collection.json @@ -14,7 +14,9 @@ "listen": "test", "script": { "exec": [ - "pm.environment.set(\"LOGON_TOKEN\", responseBody)" + "let responseData = pm.response.json();\r", + "pm.environment.set(\"LOGON_TOKEN\", responseData.token)\r", + "console.log(\"Id: \" + responseData.id)" ], "type": "text/javascript" } @@ -63,18 +65,12 @@ "method": "GET", "header": [], "url": { - "raw": "{{SCHEMA}}{{PATH}}/participant?user_id=1", + "raw": "{{SCHEMA}}{{PATH}}/participants", "host": [ "{{SCHEMA}}{{PATH}}" ], "path": [ - "participant" - ], - "query": [ - { - "key": "user_id", - "value": "1" - } + "participants" ] } }, @@ -282,7 +278,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{SCHEMA}}{{PATH}}/times?shipcall_id=1", + "raw": "{{SCHEMA}}{{PATH}}/times?shipcall_id=3", "host": [ "{{SCHEMA}}{{PATH}}" ], @@ -292,7 +288,7 @@ "query": [ { "key": "shipcall_id", - "value": "1" + "value": "3" } ] } diff --git a/misc/create_schema.sql b/misc/create_schema.sql index 1bb323f..46c31d2 100644 --- a/misc/create_schema.sql +++ b/misc/create_schema.sql @@ -8,6 +8,7 @@ CREATE TABLE `participant` ( `street` varchar(128) DEFAULT NULL, `postal_code` varchar(5) DEFAULT NULL, `city` varchar(64) DEFAULT NULL, + `type` int(10) DEFAULT NULL, `flags` int(10) unsigned DEFAULT NULL, `created` DATETIME NULL DEFAULT current_timestamp(), `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), diff --git a/misc/sample_data.sql b/misc/sample_data.sql index cf511af..986d8f7 100644 --- a/misc/sample_data.sql +++ b/misc/sample_data.sql @@ -41,7 +41,7 @@ UNLOCK TABLES; LOCK TABLES `participant` WRITE; /*!40000 ALTER TABLE `participant` DISABLE KEYS */; -INSERT INTO `participant` (`id`, `name`, `street`, `postal_code`, `city`, `flags`, `created`, `modified`) VALUES (1,'Schick Informatik','Gottlieb-Daimler-Str. 8','73614','Schorndorf',42,'2023-04-17 07:18:19',NULL); +INSERT INTO `participant` (`id`, `name`, `street`, `postal_code`, `city`, `type`, `flags`, `created`, `modified`) VALUES (1,'Schick Informatik','Gottlieb-Daimler-Str. 8','73614','Schorndorf',1,42,'2023-04-17 07:18:19',NULL); /*!40000 ALTER TABLE `participant` ENABLE KEYS */; UNLOCK TABLES; diff --git a/src/RoleEditor/MainWindow.xaml b/src/RoleEditor/MainWindow.xaml index ad6e5d9..b7953c7 100644 --- a/src/RoleEditor/MainWindow.xaml +++ b/src/RoleEditor/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:RoleEditor" mc:Ignorable="d" - Title="Bremen calling admin editor" Height="600" Width="800" Icon="Resources/lock_preferences.ico" Loaded="Window_Loaded"> + Title="Bremen calling admin editor" Height="650" Width="800" Icon="Resources/lock_preferences.ico" Loaded="Window_Loaded"> @@ -29,6 +29,7 @@ + @@ -57,16 +58,18 @@