Skip to content

Commit

Permalink
Bunch of Key methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyphp committed Nov 28, 2023
1 parent ce717e9 commit ba2588d
Show file tree
Hide file tree
Showing 32 changed files with 2,185 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Contract/Request/Key/AuthorizeInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface AuthorizeInterface extends RequestInterface
{
public function getLockId(): int;

public function getKeyId(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
26 changes: 26 additions & 0 deletions src/Contract/Request/Key/DeleteInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface DeleteInterface extends RequestInterface
{
public function getKeyId(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
26 changes: 26 additions & 0 deletions src/Contract/Request/Key/FreezeInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface FreezeInterface extends RequestInterface
{
public function getKeyId(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
26 changes: 26 additions & 0 deletions src/Contract/Request/Key/GetDetailInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface GetDetailInterface extends RequestInterface
{
public function getLockId(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
38 changes: 38 additions & 0 deletions src/Contract/Request/Key/GetListByLockInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface GetListByLockInterface extends RequestInterface
{
public function getLockId(): int;

/**
* Page no, start from 1
* @return int
*/
public function getPageNo(): int;

/**
* Items per page, max 100
* @return int
*/
public function getPageSize(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
40 changes: 40 additions & 0 deletions src/Contract/Request/Key/GetListInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface GetListInterface extends RequestInterface
{
public function getLockAlias(): ?string;

public function getGroupId(): ?int;

/**
* Page no, start from 1
* @return int
*/
public function getPageNo(): int;

/**
* Items per page, max 1000
* @return int
*/
public function getPageSize(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
89 changes: 89 additions & 0 deletions src/Contract/Request/Key/SendInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface SendInterface extends RequestInterface
{
public function getLockId(): int;

/**
* Key receiver username
* @return string
*/
public function getReceiverUsername(): string;

/**
* Key name
* @return string
*/
public function getKeyName(): string;

/**
* Returns True if key has management right of a lock to an ekey user, including rights of sending keys, creating passcodes, lock settings, etc.;
* null if not set
* @return bool|null
*/
public function isManagementRight(): ?bool;

/**
* Returns True if remote enabled, null if not set
* @return bool|null
*/
public function isRemoteUnlock(): ?bool;

/**
* Auto create TTLock account if receiverUsername is not a registered TTLock account.
* This parameter take effect only when receiverUsername is a mobile number or email, the created account's password is
* the last six characters of the username.
* @return bool
*/
public function isAutoCreateUser(): bool;

/**
* Key comments, null if not set
* @return string|null
*/
public function getRemarks(): ?string;

/**
* Key time when it becomes valid, unix time stamp in millisecond, null if not set
* @return int
*/
public function getStartTimeStamp(): int;

/**
* Key time when it becomes valid, null if not set
* @return DateTimeImmutable
*/
public function getStartDateTime(): DateTimeImmutable;

/**
* Key time when it is expired, unix time stamp in millisecond, null if not set
* @return int
*/
public function getEndTimeStamp(): int;

/**
* Key time when it is expired, null if not set
* @return DateTimeImmutable
*/
public function getEndDateTime(): DateTimeImmutable;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
28 changes: 28 additions & 0 deletions src/Contract/Request/Key/UnauthorizeInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface UnauthorizeInterface extends RequestInterface
{
public function getLockId(): int;

public function getKeyId(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
26 changes: 26 additions & 0 deletions src/Contract/Request/Key/UnfreezeInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface UnfreezeInterface extends RequestInterface
{
public function getKeyId(): int;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
30 changes: 30 additions & 0 deletions src/Contract/Request/Key/UpdateInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);

namespace SunnyPHP\TTLock\Contract\Request\Key;

use DateTimeImmutable;
use SunnyPHP\TTLock\Contract\Request\RequestInterface;

interface UpdateInterface extends RequestInterface
{
public function getKeyId(): int;

public function getKeyName(): string;

public function isRemoteUnlock(): ?bool;

/**
* Current unix time stamp in millisecond
* @see getCurrentDateTime
* @return int
*/
public function getCurrentTimeStamp(): int;

/**
* Current date & time
* @see getCurrentTimeStamp
* @return DateTimeImmutable
*/
public function getCurrentDateTime(): DateTimeImmutable;
}
Loading

0 comments on commit ba2588d

Please sign in to comment.