Skip to content

Commit

Permalink
wip Mattermost
Browse files Browse the repository at this point in the history
  • Loading branch information
guanguans committed Jan 30, 2024
1 parent 681b949 commit 8c37268
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/Mattermost/Messages/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Message extends \Guanguans\Notify\Foundation\Message
use AsPost;

protected array $defined = [
'base_uri',

'channel_id',
'message',
'file_ids',
Expand All @@ -50,6 +52,7 @@ class Message extends \Guanguans\Notify\Foundation\Message
];

protected array $required = [
'base_uri',
'channel_id',
];

Expand All @@ -63,21 +66,8 @@ class Message extends \Guanguans\Notify\Foundation\Message

private string $baseUri;

// public function __construct(string $baseUri, array $options)
// {
// parent::__construct($options);
// $this->baseUri = $baseUri;
// }

public function toHttpUri()
{
return "$this->baseUri/api/v4/posts";
}

public function baseUri(string $baseUri): self
public function toHttpUri(): string
{
$this->baseUri = $baseUri;

return $this;
return "{$this->getOption('base_uri')}/api/v4/posts";
}
}

0 comments on commit 8c37268

Please sign in to comment.