From 97e31c4caf68391c13246daf2aad88fb5e82228c Mon Sep 17 00:00:00 2001 From: Schneider Roland Date: Mon, 25 Jul 2022 20:50:20 +0200 Subject: [PATCH] add some comment --- common/manager/DoorManager.php | 16 ++++++++++------ http-client.env.json | 6 ++++++ rest.http | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 http-client.env.json create mode 100644 rest.http diff --git a/common/manager/DoorManager.php b/common/manager/DoorManager.php index 7affbc8..127f308 100644 --- a/common/manager/DoorManager.php +++ b/common/manager/DoorManager.php @@ -26,16 +26,20 @@ class DoorManager extends BaseObject /** - * @param $cardNumber - * @param $device - * @param $direction - * @param $createdAt number unix timestamp , override createdAt for doorLogs - * @param $date number unix timestamp, override date for validation check 'now' + + * @param $cardNumber 00000000: nyomogombos nyitás + * @param $device string B(gomb)|Q(qrcode)|C(nfc),E(emergency) + * @param $direction string IN|OUT + * @param $verifyOnly boolean true: akkor csak lekerdezés, false: megtörtént a mozgás (ilyenkor vonunk le egy alkalmat) + * @param $createdAt number unix timestamp , override createdAt for doorLogs + * @param $date number unix timestamp, override date for validation check 'now' * @return void * @throws BadRequestHttpException + * @throws ServerErrorHttpException * @throws \yii\base\InvalidConfigException + * @throws \yii\db\Exception */ - public function move($cardNumber, $device, $direction, $createdAt = null, $date = null) + public function move($cardNumber, $device, $direction, $verifyOnly, $createdAt = null, $date = null) { try { \Yii::$app->db->beginTransaction(); diff --git a/http-client.env.json b/http-client.env.json new file mode 100644 index 0000000..48ff237 --- /dev/null +++ b/http-client.env.json @@ -0,0 +1,6 @@ +{ + "lgyenese": { + "restapi-url": "https://cutlergyor.rschneider.hu/cutler/rest/web/index.php?r=", + "token": "123" + } +} diff --git a/rest.http b/rest.http new file mode 100644 index 0000000..dca0ac4 --- /dev/null +++ b/rest.http @@ -0,0 +1,21 @@ +POST {{restapi-url}}site/login +Accept: application/json +Content-Type: application/json + +{ + "username": "lgyenese", + "password": "digisoft" +} + +### + +POST {{restapi-url}}door/move +Accept: application/json +Content-Type: application/json +Authorization: Basic bGd5ZW5lc2U6ZGlnaXNvZnQ=' + +{ + "cardNumber": "10WMVXMZ", + "direction": "IN", + "device": "Q" +}