Compare commits
3 Commits
cc989e96f7
...
cfa750aff2
| Author | SHA1 | Date | |
|---|---|---|---|
| cfa750aff2 | |||
| 7a96e5175d | |||
| 56fa3c512e |
@ -8,11 +8,7 @@ DB_NAME=template
|
|||||||
DB_NAME_LOG=log
|
DB_NAME_LOG=log
|
||||||
|
|
||||||
# API Keys
|
# API Keys
|
||||||
AUTH_API_KEY=
|
TEMPLATE_API_KEY=
|
||||||
NOTIFICATION_API_KEY=
|
|
||||||
FILE_API_KEY=
|
|
||||||
HOMEPAGE_API_KEY=
|
|
||||||
BEE_API_KEY=
|
|
||||||
|
|
||||||
# Template Setup
|
# Template Setup
|
||||||
INIT_USER_NAME=admin
|
INIT_USER_NAME=admin
|
||||||
|
|||||||
@ -3,26 +3,7 @@
|
|||||||
return [
|
return [
|
||||||
'api' => [
|
'api' => [
|
||||||
'keys' => [
|
'keys' => [
|
||||||
'template' => $_ENV['HOMEPAGE_API_KEY'],
|
'template' => $_ENV['TEMPLATE_API_KEY'],
|
||||||
'notification' => $_ENV['NOTIFICATION_API_KEY'],
|
|
||||||
],
|
|
||||||
|
|
||||||
'services' => [
|
|
||||||
'template' => [
|
|
||||||
'host' => 'template-backend-nginx',
|
|
||||||
'apis' => [
|
|
||||||
|
|
||||||
]
|
|
||||||
],
|
|
||||||
'notification' => [
|
|
||||||
'host' => 'notification-backend-nginx',
|
|
||||||
'apis' => [
|
|
||||||
'send-mail' => [
|
|
||||||
'path' => '/api/mail/send',
|
|
||||||
'method' => 'POST'
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div id="title" class="title">
|
<div id="title" class="title">
|
||||||
<img src="assets/icon.png" />
|
<img src="assets/icon.png" />
|
||||||
<h1>Beekeeper</h1>
|
<h1>Template</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<p>Wenn du dein Passwort nicht zurückgesetzt hast, kannst du diese Nachricht ignorieren!</p>
|
<p>Wenn du dein Passwort nicht zurückgesetzt hast, kannst du diese Nachricht ignorieren!</p>
|
||||||
<br />
|
<br />
|
||||||
<p>Mit fleißigen Grüßen,</p>
|
<p>Mit fleißigen Grüßen,</p>
|
||||||
<p>Der Beekeeper</p>
|
<p>Der Template</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Template\Migrations\Template;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20241130201314 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'rename status and thermometer to reference location';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql("RENAME TABLE `thermometer` TO `location_thermometer`");
|
|
||||||
$this->addSql("RENAME TABLE `status` TO `location_status`");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql("RENAME TABLE `location_thermometer` TO `thermometer`");
|
|
||||||
$this->addSql("RENAME TABLE `location_status` TO `status`");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Template\Migrations\Template;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20241130202949 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'update procedure to last migration';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql("DROP PROCEDURE pS_LOCATION_ThermometerHistoryGraphList");
|
|
||||||
$this->addSql("
|
|
||||||
CREATE PROCEDURE pS_LOCATION_ThermometerHistoryGraphList (
|
|
||||||
IN locaiton_id BINARY(16),
|
|
||||||
IN start_at DATETIME,
|
|
||||||
IN end_at DATETIME,
|
|
||||||
IN `interval` int
|
|
||||||
)
|
|
||||||
BEGIN
|
|
||||||
SELECT
|
|
||||||
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(created_at) / (`interval` * 60)) * (`interval` * 60)) AS time_interval,
|
|
||||||
ROUND(AVG(temperature),1) AS avg_temperature,
|
|
||||||
ROUND(AVG(humidity)) AS avg_humidity
|
|
||||||
FROM
|
|
||||||
location_thermometer
|
|
||||||
WHERE
|
|
||||||
locaiton_id = locaiton_id AND
|
|
||||||
(created_at >= COALESCE(start_at, '1970-01-01 00:00:00')) AND
|
|
||||||
(created_at <= COALESCE(end_at, NOW()))
|
|
||||||
GROUP BY
|
|
||||||
time_interval
|
|
||||||
ORDER BY
|
|
||||||
time_interval ASC;
|
|
||||||
END;
|
|
||||||
");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql("DROP PROCEDURE pS_LOCATION_ThermometerHistoryGraphList");
|
|
||||||
$this->addSql("
|
|
||||||
CREATE PROCEDURE pS_LOCATION_ThermometerHistoryGraphList (
|
|
||||||
IN locaiton_id BINARY(16),
|
|
||||||
IN start_at DATETIME,
|
|
||||||
IN end_at DATETIME,
|
|
||||||
IN `interval` int
|
|
||||||
)
|
|
||||||
BEGIN
|
|
||||||
SELECT
|
|
||||||
FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(created_at) / (`interval` * 60)) * (`interval` * 60)) AS time_interval,
|
|
||||||
ROUND(AVG(temperature),1) AS avg_temperature,
|
|
||||||
ROUND(AVG(humidity)) AS avg_humidity
|
|
||||||
FROM
|
|
||||||
thermometer
|
|
||||||
WHERE
|
|
||||||
locaiton_id = locaiton_id AND
|
|
||||||
(created_at >= COALESCE(start_at, '1970-01-01 00:00:00')) AND
|
|
||||||
(created_at <= COALESCE(end_at, NOW()))
|
|
||||||
GROUP BY
|
|
||||||
time_interval
|
|
||||||
ORDER BY
|
|
||||||
time_interval ASC;
|
|
||||||
END;
|
|
||||||
");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -18,7 +18,7 @@ class RequestServiceFactory implements FactoryInterface
|
|||||||
{
|
{
|
||||||
/** @var ConfigService $configService */
|
/** @var ConfigService $configService */
|
||||||
$configService = $container->get(ConfigService::class);
|
$configService = $container->get(ConfigService::class);
|
||||||
$apiKey = $configService->resolve("api.keys.Template");
|
$apiKey = $configService->resolve("api.keys.template");
|
||||||
|
|
||||||
return new RequestService(
|
return new RequestService(
|
||||||
$apiKey,
|
$apiKey,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user