diff --git a/api-doc.json b/api-doc.json index c126a163ca3224fd63e4e5bc8a9fed08ec684cb4..a93d413ee8c6aab7f24b84e45205f81e079a501f 100644 --- a/api-doc.json +++ b/api-doc.json @@ -1,2 +1 @@ - {"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"http://localhost:8080","description":"Generated server url"}],"paths":{"/api/v1/station/update/{id}":{"put":{"tags":["station-controller"],"operationId":"update","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Station"}}}}}}},"/api/v1/sensor/update/{id}":{"put":{"tags":["sensor-controller"],"operationId":"updateSensor","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sensor"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/sensor/group/update/{id}":{"put":{"tags":["sensor-group-controller"],"operationId":"updateSensorGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorGroup"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/host/update/{id}":{"put":{"tags":["host-controller"],"operationId":"update_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Host"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Host"}}}}}}},"/api/v1/client/update/{id}":{"put":{"tags":["client-controller"],"operationId":"updateClient","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Client"}}}}}}},"/api/v1/auth/user/update/{id}":{"put":{"tags":["user-controller"],"operationId":"updateUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSignUpRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/station/add":{"post":{"tags":["station-controller"],"operationId":"save","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Station"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Station"}}}}}}},"/api/v1/server/add":{"post":{"tags":["server-controller"],"summary":"Add a reading to the database","operationId":"addReading","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingPayload"}}},"required":true},"responses":{"400":{"description":"Reading not added","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}},"200":{"description":"Reading added successfully","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}}}}},"/api/v1/sensor/group/add":{"post":{"tags":["sensor-group-controller"],"operationId":"addSensorGroup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorGroup"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/sensor/add":{"post":{"tags":["sensor-controller"],"operationId":"addSensor","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sensor"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/host/add":{"post":{"tags":["host-controller"],"operationId":"save_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Host"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Host"}}}}}}},"/api/v1/client/add":{"post":{"tags":["client-controller"],"operationId":"saveClient","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Client"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Client"}}}}}}},"/api/v1/auth/signup":{"post":{"tags":["user-controller"],"operationId":"registerUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSignUpRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["user-controller"],"operationId":"authenticateUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLoginRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/auth/add/role":{"post":{"tags":["user-controller"],"operationId":"addRole","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Role"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/station/{id}":{"get":{"tags":["station-controller"],"operationId":"getById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Station"}}}}}}},"/api/v1/station/name/{name}":{"get":{"tags":["station-controller"],"operationId":"getByName","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Station"}}}}}}},"/api/v1/station/all":{"get":{"tags":["station-controller"],"operationId":"getAll","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Station"}}}}}}}},"/api/v1/server/get/sensor/range":{"get":{"tags":["server-controller"],"summary":"Get readings by sensor name and time range","operationId":"getReadingsBySensorIdAndTimeRange","parameters":[{"name":"sensorId","in":"query","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"403":{"description":"Accessing the resource you were trying to reach is forbidden","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"401":{"description":"You are not authorized to view the resource","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"404":{"description":"The resource you were trying to reach is not found","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"200":{"description":"Successfully retrieved readings by sensor name and time range","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}}},"/api/v1/server/get/sensor/error/range":{"get":{"tags":["server-controller"],"summary":"Get readings by sensor name and error type and time range","operationId":"getReadingsBySensorIdAndErrorTypeAndTimeRange","parameters":[{"name":"sensorId","in":"query","required":true,"schema":{"type":"string"}},{"name":"errorType","in":"query","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successfully retrieved readings by sensor name and error type and time range","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"403":{"description":"Accessing the resource you were trying to reach is forbidden","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"401":{"description":"You are not authorized to view the resource","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}},"404":{"description":"The resource you were trying to reach is not found","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}}}}}}},"/api/v1/server/get/lvl1/{station}":{"get":{"tags":["server-controller"],"summary":"Get level one response for a group id and a time range","operationId":"getLevelOneResponseForGroupAndTimeRange","parameters":[{"name":"station","in":"path","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Successfully retrieved level one response for a group id and a time range","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LevelOneResponse"}}}},"403":{"description":"Accessing the resource you were trying to reach is forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LevelOneResponse"}}}},"401":{"description":"You are not authorized to view the resource","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LevelOneResponse"}}}},"404":{"description":"The resource you were trying to reach is not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/LevelOneResponse"}}}}}}},"/api/v1/sensor/{id}":{"get":{"tags":["sensor-controller"],"operationId":"getSensorById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Sensor"}}}}}}},"/api/v1/sensor/group/{id}":{"get":{"tags":["sensor-group-controller"],"operationId":"getSensorGroupById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SensorGroup"}}}}}}},"/api/v1/sensor/group/name/{name}":{"get":{"tags":["sensor-group-controller"],"operationId":"getSensorGroupByName","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/SensorGroup"}}}}}}},"/api/v1/sensor/group/all":{"get":{"tags":["sensor-group-controller"],"operationId":"getAllSensorGroups","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SensorGroup"}}}}}}}},"/api/v1/sensor/all":{"get":{"tags":["sensor-controller"],"operationId":"getAllSensors","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Sensor"}}}}}}}},"/api/v1/host/{id}":{"get":{"tags":["host-controller"],"operationId":"getById_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Host"}}}}}}},"/api/v1/host/name/{name}":{"get":{"tags":["host-controller"],"operationId":"getByName_1","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Host"}}}}}}},"/api/v1/host/all":{"get":{"tags":["host-controller"],"operationId":"getAll_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Host"}}}}}}}},"/api/v1/client/{id}":{"get":{"tags":["client-controller"],"operationId":"getClientById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Client"}}}}}}},"/api/v1/client/name/{name}":{"get":{"tags":["client-controller"],"operationId":"getClientByName","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Client"}}}}}}},"/api/v1/client/all":{"get":{"tags":["client-controller"],"operationId":"getAllClients","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Client"}}}}}}}},"/api/v1/auth/users":{"get":{"tags":["user-controller"],"operationId":"getAllUsers","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/station/delete/{id}":{"delete":{"tags":["station-controller"],"operationId":"delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}}}}},"/api/v1/station/delete/all":{"delete":{"tags":["station-controller"],"operationId":"deleteAll","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}}}}},"/api/v1/server/delete/all":{"delete":{"tags":["server-controller"],"summary":"Delete all readings from database","operationId":"deleteAllReadings","responses":{"200":{"description":"Successfully deleted all readings from database","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}},"403":{"description":"Accessing the resource you were trying to reach is forbidden","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}},"401":{"description":"You are not authorized to view the resource","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}},"404":{"description":"The resource you were trying to reach is not found","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}}}}},"/api/v1/sensor/group/delete/{id}":{"delete":{"tags":["sensor-group-controller"],"operationId":"deleteSensorGroup","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/sensor/group/delete/all":{"delete":{"tags":["sensor-group-controller"],"operationId":"deleteAllSensorGroups","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/sensor/delete/{id}":{"delete":{"tags":["sensor-controller"],"operationId":"deleteSensor","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/sensor/delete/all":{"delete":{"tags":["sensor-controller"],"operationId":"deleteAllSensors","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/host/delete/{id}":{"delete":{"tags":["host-controller"],"operationId":"delete_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}}}}},"/api/v1/host/delete/all":{"delete":{"tags":["host-controller"],"operationId":"deleteAll_1","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string","enum":["100 CONTINUE","101 SWITCHING_PROTOCOLS","102 PROCESSING","103 CHECKPOINT","200 OK","201 CREATED","202 ACCEPTED","203 NON_AUTHORITATIVE_INFORMATION","204 NO_CONTENT","205 RESET_CONTENT","206 PARTIAL_CONTENT","207 MULTI_STATUS","208 ALREADY_REPORTED","226 IM_USED","300 MULTIPLE_CHOICES","301 MOVED_PERMANENTLY","302 FOUND","302 MOVED_TEMPORARILY","303 SEE_OTHER","304 NOT_MODIFIED","305 USE_PROXY","307 TEMPORARY_REDIRECT","308 PERMANENT_REDIRECT","400 BAD_REQUEST","401 UNAUTHORIZED","402 PAYMENT_REQUIRED","403 FORBIDDEN","404 NOT_FOUND","405 METHOD_NOT_ALLOWED","406 NOT_ACCEPTABLE","407 PROXY_AUTHENTICATION_REQUIRED","408 REQUEST_TIMEOUT","409 CONFLICT","410 GONE","411 LENGTH_REQUIRED","412 PRECONDITION_FAILED","413 PAYLOAD_TOO_LARGE","413 REQUEST_ENTITY_TOO_LARGE","414 URI_TOO_LONG","414 REQUEST_URI_TOO_LONG","415 UNSUPPORTED_MEDIA_TYPE","416 REQUESTED_RANGE_NOT_SATISFIABLE","417 EXPECTATION_FAILED","418 I_AM_A_TEAPOT","419 INSUFFICIENT_SPACE_ON_RESOURCE","420 METHOD_FAILURE","421 DESTINATION_LOCKED","422 UNPROCESSABLE_ENTITY","423 LOCKED","424 FAILED_DEPENDENCY","425 TOO_EARLY","426 UPGRADE_REQUIRED","428 PRECONDITION_REQUIRED","429 TOO_MANY_REQUESTS","431 REQUEST_HEADER_FIELDS_TOO_LARGE","451 UNAVAILABLE_FOR_LEGAL_REASONS","500 INTERNAL_SERVER_ERROR","501 NOT_IMPLEMENTED","502 BAD_GATEWAY","503 SERVICE_UNAVAILABLE","504 GATEWAY_TIMEOUT","505 HTTP_VERSION_NOT_SUPPORTED","506 VARIANT_ALSO_NEGOTIATES","507 INSUFFICIENT_STORAGE","508 LOOP_DETECTED","509 BANDWIDTH_LIMIT_EXCEEDED","510 NOT_EXTENDED","511 NETWORK_AUTHENTICATION_REQUIRED"]}}}}}}},"/api/v1/client/delete/{id}":{"delete":{"tags":["client-controller"],"operationId":"deleteClient","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/client/delete/all":{"delete":{"tags":["client-controller"],"operationId":"deleteAllClients","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/v1/auth/user/delete/{id}":{"delete":{"tags":["user-controller"],"operationId":"deleteUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"Location":{"type":"object","properties":{"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"},"altitude":{"type":"number","format":"double"},"comment":{"type":"string"}}},"Station":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"location":{"$ref":"#/components/schemas/Location"},"createdDate":{"type":"string","format":"date-time"},"updatedDate":{"type":"string","format":"date-time"},"host":{"type":"string"},"clients":{"type":"array","items":{"type":"string"}},"diary":{"type":"string"}}},"Measurement":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["PRECIPITATION","SOLAR_RADIATION","SOIL_MOISTURE","SOIL_TEMPERATURE","HUMIDITY","TEMPERATURE","CIRCUMFERENCE_INCREMENT","SHUNT_VOLTAGE","BUS_VOLTAGE","CURRENT_mA","POWER_mW","LOAD_VOLTAGE_V","INA219_OVERFLOW","BATTERY_VOLTAGE"]},"maxValue":{"type":"number","format":"double"},"minValue":{"type":"number","format":"double"},"unit":{"type":"string"},"comment":{"type":"string"},"precision":{"type":"integer","format":"int32"},"maxReadoutDifference":{"type":"number","format":"double"},"maxFrozenTimeInSeconds":{"type":"integer","format":"int32"},"maxRateOfChange":{"type":"number","format":"double"},"minVariationCoefficient":{"type":"number","format":"double"},"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"},"initialCircumference":{"type":"number","format":"double"},"treeType":{"type":"string","enum":["LARCH","SPRUCE"]}}},"Sensor":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"protocol":{"type":"string"},"protocolAddress":{"type":"string"},"hardwareName":{"type":"string"},"uniqueHardwareName":{"type":"string"},"description":{"type":"string"},"measurements":{"type":"array","items":{"$ref":"#/components/schemas/Measurement"}}}},"SensorGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sensors":{"type":"array","items":{"type":"string"}},"station":{"type":"string"},"measurementType":{"type":"string","enum":["PRECIPITATION","SOLAR_RADIATION","SOIL_MOISTURE","SOIL_TEMPERATURE","HUMIDITY","TEMPERATURE","CIRCUMFERENCE_INCREMENT","SHUNT_VOLTAGE","BUS_VOLTAGE","CURRENT_mA","POWER_mW","LOAD_VOLTAGE_V","INA219_OVERFLOW","BATTERY_VOLTAGE"]}}},"Host":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"simId":{"type":"string"},"mac":{"type":"string"}}},"Client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mac":{"type":"string"},"description":{"type":"string"},"connectionType":{"type":"string"},"sensors":{"type":"array","items":{"type":"string"}}}},"UserSignUpRequest":{"required":["email","password","username"],"type":"object","properties":{"username":{"maxLength":20,"minLength":3,"type":"string"},"email":{"maxLength":50,"minLength":0,"type":"string"},"password":{"maxLength":40,"minLength":6,"type":"string"},"roles":{"uniqueItems":true,"type":"array","items":{"type":"string"}}}},"ReadingPayload":{"type":"object","properties":{"host":{"type":"string"},"client":{"type":"string"},"sensorProtocol":{"type":"string"},"protocolAddress":{"type":"string"},"hardwareName":{"type":"string"},"readings":{"type":"array","items":{"$ref":"#/components/schemas/ReadingValue"}},"timestamp":{"type":"integer","format":"int64"},"sensorError":{"type":"string","enum":["NO_ERROR","INVALID_TIMESTAMP","INVALID_SENSOR_ID","INVALID_SENSOR_TYPE","INVALID_READING_VALUE_RANGE","INVALID_READING_VALUE_TOO_LOW","INVALID_READING_VALUE_TOO_HIGH","INVALID_READING_VALUE_NAN","INVALID_READING_VALUE_DUPLICATE","INVALID_READING_VALUE_BELOW_VAR_COFF","INVALID_READING_VALUE_ABOVE_RATE_OF_CHANGE","INVALID_READING_VALUE_LOWER_FOR_SOLAR_ELEVATION","INVALID_READING_VALUE_NOT_ZERO_FOR_SOLAR_ELEVATION","INVALID_READING_VALUE_FROZEN","INVALID_READING_VALUE_SPIKE","DATA_OK","SENSOR_NOT_FOUND","SENSOR_NOT_CONNECTED","NO_DATA","SENSOR_DOES_NOT_RETURN_DATA","BATTERY_VOLTAGE_TOO_LOW","INVALID_VALUE","SENSOR_INIT_FAILED","INA219_OVERFLOW","CONNECTION_ENDED_PREMATURELY","WRONG_CRC","UNKNOWN_ERROR_TYPE"]}}},"ReadingValue":{"type":"object","properties":{"name":{"type":"string","enum":["PRECIPITATION","SOLAR_RADIATION","SOIL_MOISTURE","SOIL_TEMPERATURE","HUMIDITY","TEMPERATURE","CIRCUMFERENCE_INCREMENT","SHUNT_VOLTAGE","BUS_VOLTAGE","CURRENT_mA","POWER_mW","LOAD_VOLTAGE_V","INA219_OVERFLOW","BATTERY_VOLTAGE"]},"value":{"type":"number","format":"double"}}},"UserLoginRequest":{"required":["password","username"],"type":"object","properties":{"username":{"maxLength":20,"minLength":3,"type":"string"},"password":{"maxLength":40,"minLength":6,"type":"string"}}},"Role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","enum":["ROLE_USER","ROLE_MANAGER","ROLE_ADMIN"]}}},"Document":{"type":"object","properties":{"empty":{"type":"boolean"}},"additionalProperties":{"type":"object"}},"AvgMinMax":{"type":"object","properties":{"name":{"type":"string"},"min":{"$ref":"#/components/schemas/ValueWithTimestamp"},"max":{"$ref":"#/components/schemas/ValueWithTimestamp"},"avg":{"type":"number","format":"double"},"measurementType":{"type":"string","enum":["PRECIPITATION","SOLAR_RADIATION","SOIL_MOISTURE","SOIL_TEMPERATURE","HUMIDITY","TEMPERATURE","CIRCUMFERENCE_INCREMENT","SHUNT_VOLTAGE","BUS_VOLTAGE","CURRENT_mA","POWER_mW","LOAD_VOLTAGE_V","INA219_OVERFLOW","BATTERY_VOLTAGE"]},"isSensorGroup":{"type":"boolean"}}},"DendrometerDailyValue":{"type":"object","properties":{"name":{"type":"string"},"mds":{"$ref":"#/components/schemas/DendrometerMDS"},"deltaR":{"$ref":"#/components/schemas/DendrometerDeltaR"},"std":{"type":"number","format":"double"},"isSensorGroup":{"type":"boolean"}}},"DendrometerDeltaR":{"type":"object","properties":{"value":{"type":"number","format":"double"},"duration":{"type":"number","format":"double"}}},"DendrometerMDS":{"type":"object","properties":{"value":{"type":"number","format":"double"},"duration":{"type":"number","format":"double"}}},"LevelOneResponse":{"type":"object","properties":{"sumOrAvg":{"type":"array","items":{"$ref":"#/components/schemas/SumOrAvg"}},"avgMinMax":{"type":"array","items":{"$ref":"#/components/schemas/AvgMinMax"}},"dendrometerDailyValues":{"type":"array","items":{"$ref":"#/components/schemas/DendrometerDailyValue"}}}},"SumOrAvg":{"type":"object","properties":{"type":{"type":"string","enum":["SUM","AVG"]},"name":{"type":"string"},"value":{"type":"number","format":"double"},"measurementType":{"type":"string","enum":["PRECIPITATION","SOLAR_RADIATION","SOIL_MOISTURE","SOIL_TEMPERATURE","HUMIDITY","TEMPERATURE","CIRCUMFERENCE_INCREMENT","SHUNT_VOLTAGE","BUS_VOLTAGE","CURRENT_mA","POWER_mW","LOAD_VOLTAGE_V","INA219_OVERFLOW","BATTERY_VOLTAGE"]},"isSensorGroup":{"type":"boolean"}}},"ValueWithTimestamp":{"type":"object","properties":{"value":{"type":"number","format":"double"},"timestamp":{"type":"string","format":"date-time"}}}}}} diff --git a/projects/generated-api/README.md b/projects/generated-api/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b0a56652998f3526456b6ada92ad9342cebba850 --- /dev/null +++ b/projects/generated-api/README.md @@ -0,0 +1,24 @@ +# SwaggerClient + +This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.0. + +## Code scaffolding + +Run `ng generate component component-name --project swagger-client` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project swagger-client`. +> Note: Don't forget to add `--project swagger-client` or else it will be added to the default project in your `angular.json` file. + +## Build + +Run `ng build swagger-client` to build the project. The build artifacts will be stored in the `dist/` directory. + +## Publishing + +After building your library with `ng build swagger-client`, go to the dist folder `cd dist/swagger-client` and run `npm publish`. + +## Running unit tests + +Run `ng test swagger-client` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/projects/generated-api/ng-package.json b/projects/generated-api/ng-package.json new file mode 100644 index 0000000000000000000000000000000000000000..a322d7db56ac1c13ce1484ce4d593153bbf29b16 --- /dev/null +++ b/projects/generated-api/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/swagger-client", + "lib": { + "entryFile": "src/public-api.ts" + } +} \ No newline at end of file diff --git a/projects/generated-api/package.json b/projects/generated-api/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9ca422194523e8f135205b4eb8784a3c7ae0ca6c --- /dev/null +++ b/projects/generated-api/package.json @@ -0,0 +1,11 @@ +{ + "name": "swagger-client", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^15.0.0", + "@angular/core": "^15.0.0" + }, + "dependencies": { + "tslib": "^2.3.0" + } +} \ No newline at end of file diff --git a/projects/generated-api/src/encoder.ts b/projects/generated-api/src/encoder.ts index d34eab7a83f39b10bc7ef70a14c986ab81b8aa57..4999a7943922970204137e95b76fd0f974a0761e 100644 --- a/projects/generated-api/src/encoder.ts +++ b/projects/generated-api/src/encoder.ts @@ -6,7 +6,6 @@ * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 */ export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { - override encodeKey(k: string): string { k = super.encodeKey(k); return k.replace(/\+/gi, '%2B'); diff --git a/projects/generated-api/src/model/document.ts b/projects/generated-api/src/model/document.ts index 722a36f17122c017960310bcd0e558c24c89de3c..09ea815dbd5d3a1312796569c9292f5ada0229e0 100644 --- a/projects/generated-api/src/model/document.ts +++ b/projects/generated-api/src/model/document.ts @@ -10,7 +10,6 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ - // @ts-ignore export interface Document extends null<String, any> { [key: string]: any; diff --git a/projects/generated-api/tsconfig.lib.json b/projects/generated-api/tsconfig.lib.json new file mode 100644 index 0000000000000000000000000000000000000000..543fd474ab171ea4339bb1f7a83ea14d1d1abec2 --- /dev/null +++ b/projects/generated-api/tsconfig.lib.json @@ -0,0 +1,14 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "**/*.spec.ts" + ] +} diff --git a/projects/generated-api/tsconfig.lib.prod.json b/projects/generated-api/tsconfig.lib.prod.json new file mode 100644 index 0000000000000000000000000000000000000000..06de549e10727dedb268c99e390ce20233ac6080 --- /dev/null +++ b/projects/generated-api/tsconfig.lib.prod.json @@ -0,0 +1,10 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": { + "compilationMode": "partial" + } +} diff --git a/projects/generated-api/tsconfig.spec.json b/projects/generated-api/tsconfig.spec.json new file mode 100644 index 0000000000000000000000000000000000000000..ce7048bc2c7099890ce58bec3117d2e8a45c20b3 --- /dev/null +++ b/projects/generated-api/tsconfig.spec.json @@ -0,0 +1,14 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/src/app/app.component.html b/src/app/app.component.html index a70525f00cf74274d2b40902156c7eacde9b7b2b..48796809d9d5f577eb85b536b07b9cca63f5ebbb 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -35,7 +35,7 @@ -<app-home-tailwindcss></app-home-tailwindcss> +<app-pro-view></app-pro-view> diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac504c17e9fa13d8eb52959537d496323b735c9b..74677f657ca9448e98b81d0565aba81ee572e909 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -42,6 +42,8 @@ import {CjsTimelineMultiple} from "./module/components/charts/Cjs-timeline-multi import {MatButtonModule} from "@angular/material/button"; import { ThermometerComponent } from './module/components/thermometer/thermometer.component'; import { HomeTailwindcssComponent } from './module/pages/home-tailwindcss/home-tailwindcss.component'; +import {isNamespaceImportNode} from "@angular/cdk/schematics"; +import {ServerControllerService} from "../../projects/generated-api/src"; @NgModule({ declarations: [ @@ -90,7 +92,7 @@ import { HomeTailwindcssComponent } from './module/pages/home-tailwindcss/home-t ApiModule, MatButtonModule, ], - providers: [EventEmitterService,{provide:HTTP_INTERCEPTORS,useClass:InterceptorService,multi:true}], + providers: [EventEmitterService,{provide:HTTP_INTERCEPTORS,useClass:InterceptorService,multi:true},ServerControllerService], bootstrap: [AppComponent], }) export class AppModule { diff --git a/src/app/module/components/lev0Ver2/lev0.component.html b/src/app/module/components/lev0Ver2/lev0.component.html index 294eb375453205bbdf55dac979bc23a14265e41a..5da284fe5da4dfe91ac72cb7a057a966aaf7e70f 100644 --- a/src/app/module/components/lev0Ver2/lev0.component.html +++ b/src/app/module/components/lev0Ver2/lev0.component.html @@ -23,14 +23,21 @@ <div class="card-b"> <div class="header-left"> <h5>{{sumAvg.name}}</h5> - <h2>{{sumAvg.value.toFixed(1)}}{{" "+unitMapper.get(sumAvg.sensorType)}}</h2> - <div><h4>{{typeMapper.get( sumAvg.type)}}</h4></div> + <h2 *ngIf="sumAvg.measurementType?.toString()=='SOLAR_RADIATION' "> + {{sumAvg.value?.toFixed(1)}}{{" "}}w/m<sup>2</sup> + </h2> + <h2 *ngIf="sumAvg.measurementType?.toString()!='SOLAR_RADIATION' "> + {{sumAvg.value?.toFixed(1)}}{{" "+unitMapper.get(sumAvg.measurementType+"")}} + </h2> + <div><h4>{{typeMapper.get( sumAvg.type+"")}}</h4></div> </div> <div class="header-right"> - <i class="material-icons" style="font-size:80px;color: black">{{iconMapper.get(sumAvg.sensorType)}}</i> + <i class="material-icons" style="font-size:80px;color: black">{{iconMapper.get(sumAvg.measurementType+"")}}</i> </div> + </div> </div> + </div> @@ -47,17 +54,17 @@ <main> <div class="min"> <h3>Min</h3> - <h3>{{avgMMax.min.value.toFixed(2)}}</h3> + <h3>{{avgMMax.min?.value?.toFixed(2)}}</h3> </div> <div class="avg"> <h3>Avg</h3> - <h3>{{avgMMax.avg.toFixed(2)}}</h3> + <h3>{{avgMMax.avg?.toFixed(2)}}</h3> </div> <div class="max"> <h3>Max</h3> - <h3>{{avgMMax.max.value.toFixed(2)}}</h3> + <h3>{{avgMMax.max?.value?.toFixed(2)}}</h3> </div> </main> </div> @@ -81,7 +88,7 @@ <h5 class="text-gray-500 text-xs">Maximum daily shrinkage</h5> </div> <div class="flex items-end justify-center"> - <h1 class=" flex justify-center text-3xl font-bold">{{dent.mds?.value}}</h1> + <h1 class=" flex justify-center text-3xl font-bold">{{dent.mds?.value?.toFixed(2)}}</h1> <h3 class="mb-1 ml-1 text-slate-400">mm </h3> </div> </div> @@ -92,7 +99,7 @@ <h5 class="text-gray-500 text-xs">Radius increment</h5> </div> <div class="flex items-end justify-center"> - <h1 class=" flex justify-center text-3xl font-bold">{{dent.deltaR?.value}}</h1> + <h1 class=" flex justify-center text-3xl font-bold">{{dent.deltaR?.value?.toFixed(2)}}</h1> <h3 class="mb-1 ml-1 text-slate-400">mm </h3> </div> </div> @@ -103,34 +110,6 @@ </div> - - <div class="w-full flex flex-row items-end justify-center flex-wrap"> - - <div class="card-dendrometer"> - <h1>Dendrometer</h1> - - <div class="headers"> - <div class="element"> - <mat-icon style="color: #ff6f3c; ;margin-bottom: 10px; margin-right: 5px;">unfold_more</mat-icon> - <h5>ausdehnen</h5> - </div> - - <div class="element"> - <mat-icon style="color: #155263;margin-bottom: 10px; margin-right: 5px;">unfold_less</mat-icon> - <h5>kontraktion</h5> - </div> - - <div class="element"> - <mat-icon style="color: #ffc93c;margin-bottom: 10px; margin-right: 5px;">vertical_align_top</mat-icon> - <h5>tatsächliche Ausdehnung</h5> - </div> - </div> - - <app-Cjs-timline *ngIf="threePhaseDendromete" [chartId]="chartId" [threePhaseDenrometer]="this.threePhaseDendromete"></app-Cjs-timline> - </div> - - </div> - </div> diff --git a/src/app/module/components/lev0Ver2/lev0.component.ts b/src/app/module/components/lev0Ver2/lev0.component.ts index fe8ea6b0a0a759e13376968ada1046b9677efd80..7c18a40b3b16a92999a5e50e75b10a5017c54376 100644 --- a/src/app/module/components/lev0Ver2/lev0.component.ts +++ b/src/app/module/components/lev0Ver2/lev0.component.ts @@ -1,12 +1,22 @@ import { Component } from '@angular/core'; import {ApiService} from "../../../shared/api.service"; -import {Lv1} from "../../../core/service/level1/Lv1"; -import {AvgMinMax} from "../../../core/service/level1/AvgMinMax"; -import {SumOrAvg} from "../../../core/service/level1/SumOrAvg"; + + +//import {SumOrAvg} from "../../../core/service/level1/SumOrAvg"; import {FormControl, FormGroup} from "@angular/forms"; import {DatePipe} from "@angular/common"; import {ThreePhaseDendrometer} from "../../../core/service/level1/ThreePhaseDendrometer"; -import {DendrometerDailyValue} from "../../../../../projects/generated-api/src"; +import { + AvgMinMax, + DendrometerDailyValue, + LevelOneResponse, + ServerControllerService, + SumOrAvg +} from "../../../../../projects/generated-api/src"; +import {Lv1} from "../../../core/service/level1/Lv1"; + + + @Component({ selector: 'app-lev0Ver2', @@ -14,43 +24,20 @@ import {DendrometerDailyValue} from "../../../../../projects/generated-api/src"; styleUrls: ['./lev0.component.scss'] }) export class Lev0Ver2Component { - dentrometerDailyValue:DendrometerDailyValue[]=[ - { - name: "name", - mds: { - value: 1.23, - duration: 456 - }, - deltaR: { - value: 7.89, - duration: 2 - }, - std: 0.123, - isSensorGroup: true - }, - { - name: "name2", - mds: { - value: 1.23, - duration: 456 - }, - deltaR: { - value: 7.89, - duration: 2 - }, - std: 0.123, - isSensorGroup: true - } - ] - - constructor(private api:ApiService) { + dentrometerDailyValue:DendrometerDailyValue[]=[] + + constructor(private api:ApiService, + private serverControllerService:ServerControllerService + ) { this.dateControl.valueChanges.subscribe(date => { this.reload() }); } - lv1:Lv1 | undefined; + + levelOne!:LevelOneResponse avgMinMax:AvgMinMax[]=[] sumOrAvg:SumOrAvg[]=[] + threePhaseDendromete!:ThreePhaseDendrometer chartId:String="line20" @@ -63,63 +50,37 @@ export class Lev0Ver2Component { dateControl = new FormControl(new Date()); iconMapper = new Map<String, String>([ ["SOLAR_RADIATION", "sunny"], - ["SOIL_MOISTURE", "water"] + ["SOIL_MOISTURE", "water"], + ["","unknown"] ]); unitMapper = new Map<String, String>([ ["SOLAR_RADIATION", "W/m2"], - ["SOIL_MOISTURE", "vwc"] + ["SOIL_MOISTURE", "vwc"], + ["","unknown"] ]); typeMapper = new Map<String, String>([ ["AVG", "Durchschnitt"], - ["SUM", "Totale Summe"] + ["SUM", "Totale Summe"], + ["","unknown"] ]); ngOnInit(){ this.api.get("http://localhost:8080/api/v1/server/get/lvl1/ibk_s_id?date=15-04-2022").subscribe( res=>{ - this.lv1=res - console.log(res) - console.log("avgMinMax",this.lv1?.avgMinMax[0].min.value) + this.levelOne=res // @ts-ignore - this.avgMinMax=this.lv1.avgMinMax - console.log("sumOrAvg",this.lv1?.sumOrAvg[0].type) + this.avgMinMax=this.levelOne.avgMinMax // @ts-ignore - this.sumOrAvg=this.lv1.sumOrAvg + this.sumOrAvg=this.levelOne.sumOrAvg // @ts-ignore - this.threePhaseDendromete=this.lv1.threePhaseDendrometer - console.log("parent",this.threePhaseDendromete) + this.dentrometerDailyValue=this.levelOne.dendrometerDailyValues } ) } - send() { - console.log(this.range.value.start?.toISOString().replace("T"," ").replace("Z","")) - let from=this.range.value.start?.toISOString().replace("T"," ").replace("Z","").replaceAll(':',"."); - let to=this.range.value.end?.toISOString().replace("T"," ").replace("Z","").replaceAll(':',"."); - console.log(from+"&"+to) - let datePipe = new DatePipe('en-US'); - let dateStart = datePipe.transform(this.range.value.start, 'dd.MM.yyyy HH:mm:ss'); - let dateEnd = datePipe.transform(this.range.value.end, 'dd.MM.yyyy HH:mm:ss'); - console.log(dateStart) - console.log(dateEnd) - console.log("http://localhost:8080/api/v1/server/get/lvl1/IBK?from="+dateStart+"&to="+dateEnd) - this.api.get("http://localhost:8080/api/v1/server/get/lvl1/IBK?from="+dateStart+"&to="+dateEnd).subscribe( - res=>{ - this.lv1=res - console.log(res) - console.log("avgMinMax",this.lv1?.avgMinMax[0].min.value) - // @ts-ignore - this.avgMinMax=this.lv1.avgMinMax - console.log(this.avgMinMax) - console.log("sumOrAvg",this.lv1?.sumOrAvg[0].type) - // @ts-ignore - this.sumOrAvg=this.lv1.sumOrAvg - } - ) - } reload() { console.log(this.dateControl.value) @@ -128,22 +89,15 @@ export class Lev0Ver2Component { console.log(dateStart) this.api.get("http://localhost:8080/api/v1/server/get/lvl1/ibk_s_id?date="+dateStart).subscribe( res=>{ - this.lv1=res - console.log(res) - console.log("avgMinMax",this.lv1?.avgMinMax[0].min.value) + this.levelOne=res // @ts-ignore - this.avgMinMax=this.lv1.avgMinMax - console.log(this.avgMinMax) - console.log("sumOrAvg",this.lv1?.sumOrAvg[0].type) + this.avgMinMax=this.levelOne.avgMinMax // @ts-ignore - this.sumOrAvg=this.lv1.sumOrAvg + this.sumOrAvg=this.levelOne.sumOrAvg // @ts-ignore - this.threePhaseDendromete=this.lv1.threePhaseDendrometer + this.dentrometerDailyValue=this.levelOne.dendrometerDailyValues } ) } } -export interface Hero { - id: number; - name: string; -} + diff --git a/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.css b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.html b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.html new file mode 100644 index 0000000000000000000000000000000000000000..86233953e598161952e0711013f1cd69021af447 --- /dev/null +++ b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.html @@ -0,0 +1,9 @@ +<div class="h-screen w-full grid grid-cols-1 md:grid-cols-12 grid-rows-6 md:grid-rows-1"> + + <header class="col-span-12 md:col-span-11 row-span-1 md:row-span-1 bg-cyan-100">header</header> + <section class="col-span-12 md:col-span-1 row-span-1 md:row-span-1 bg-gray-700"></section> + <main class="col-span-12 md:col-span-11 row-span-5 md:row-span-1 bg-dark">main</main> + <aside class="col-span-12 md:col-span-1 row-span-5 md:row-span-1 flex flex-col items-end bg-gray-700 transition duration-250 ease-in-out"> + <div class="mt-5 w-full flex flex-col items-center text-white">.container-logo</div> + </aside> +</div> diff --git a/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.spec.ts b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d6e6e5d9aead3c074df5a5f69a0458f878b1bcb --- /dev/null +++ b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeTailwindcssComponent } from './home-tailwindcss.component'; + +describe('HomeTailwindcssComponent', () => { + let component: HomeTailwindcssComponent; + let fixture: ComponentFixture<HomeTailwindcssComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ HomeTailwindcssComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(HomeTailwindcssComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.ts b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..adf3b4d7f69e4525e64da0ddd48a786cf4d46816 --- /dev/null +++ b/src/app/module/pages/home-tailwindcss/home-tailwindcss.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-home-tailwindcss', + templateUrl: './home-tailwindcss.component.html', + styleUrls: ['./home-tailwindcss.component.css'] +}) +export class HomeTailwindcssComponent { + +}