intiail
All checks were successful
Deploy Dev / Push (pull_request) Successful in 37s
Deploy Dev / Build (pull_request) Successful in 1m13s
Deploy Dev / Deploy dev (pull_request) Successful in 13s

This commit is contained in:
Egor Matveev
2025-06-13 00:25:14 +03:00
commit 6e257edcc0
11 changed files with 368 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package routers
import (
"encoding/json"
endpoints "monitoring/app/storage/clickhouse/tables"
"net/http"
)
func AddEndpointMetric (r *http.Request) (interface{}, int) {
d := json.NewDecoder(r.Body)
body := endpoints.EndpointMetric{}
err := d.Decode(&body)
if err != nil {
return nil, http.StatusBadRequest
}
err = endpoints.AddEndpointMetric(body)
if err != nil {
return nil, http.StatusInternalServerError
}
return nil, http.StatusAccepted
}