mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
Fixed implimentation, added to openapi.json
This commit is contained in:
parent
011fa8117d
commit
2285e290ff
|
|
@ -146,6 +146,41 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/system/time": {
|
||||||
|
"get": {
|
||||||
|
"summary": "Returns the current server time",
|
||||||
|
"tags": [
|
||||||
|
"System"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"$ref": "#/components/parameters/offsettime"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "A TimeResponse object",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/TimeResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "The operation was not successful",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/Error400"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/system/log-missing-localization": {
|
"/system/log-missing-localization": {
|
||||||
"post": {
|
"post": {
|
||||||
"summary": "Logs a missing localization string",
|
"summary": "Logs a missing localization string",
|
||||||
|
|
@ -5170,6 +5205,28 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"TimeResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timezone": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"time_local": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"time_utc": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"timestamp": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"offset": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"UserSetting": {
|
"UserSetting": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -5222,6 +5279,15 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"offsettime": {
|
||||||
|
"in": "query",
|
||||||
|
"name": "offset",
|
||||||
|
"required": false,
|
||||||
|
"description": "Offset of timestamp in seconds. Can be positive or negative.",
|
||||||
|
"schema": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
"query": {
|
"query": {
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"name": "query[]",
|
"name": "query[]",
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ class ApplicationService extends BaseService
|
||||||
|
|
||||||
private static function convertToUtc(int $timestamp):string
|
private static function convertToUtc(int $timestamp):string
|
||||||
{
|
{
|
||||||
$timestamp = time();
|
|
||||||
$dt = new \DateTime('now', new \DateTimeZone('UTC'));
|
$dt = new \DateTime('now', new \DateTimeZone('UTC'));
|
||||||
$dt->setTimestamp($timestamp);
|
$dt->setTimestamp($timestamp);
|
||||||
return $dt->format('Y-m-d H:i:s');
|
return $dt->format('Y-m-d H:i:s');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user