Add depot, attendant, jetfire, optimus, ota services with kustomize overlays

This commit is contained in:
Chris Rai
2026-01-31 15:35:07 -05:00
parent a0ec642ca1
commit 9a5cb2f547
404 changed files with 38817 additions and 16 deletions

View File

@@ -0,0 +1,45 @@
package handlers
import (
"net/http"
"otaupdate/services"
"github.com/fiskerinc/cloud-services/pkg/common"
"github.com/fiskerinc/cloud-services/pkg/utils"
"github.com/fiskerinc/cloud-services/pkg/utils/urlhelper"
"github.com/fiskerinc/cloud-services/pkg/validator"
"github.com/fiskerinc/cloud-services/pkg/loggerdataresp"
)
// HandleUpdateManifestDelete godoc
// @Summary Delete update manifest
// @Description Delete update manifest data. Requires delete permissions
// @Accept json
// @Produce json
// @Param Authorization header string false "Bearer <ID token>"
// @Param Api-Key header string false "<API token>"
// @Param id query int false "Update manifest id"
// @Success 200 {object} common.JSONMessage
// @Failure 400 {object} common.JSONError "Bad request"
// @Failure 401 {object} common.JSONError "Unauthorized"
// @Failure 503 {object} common.JSONError "Service unavailable"
// @Router /manifest [delete]
func HandleUpdateManifestDelete(w http.ResponseWriter, r *http.Request) {
qs := r.URL.Query()
um := common.UpdateManifest{
ID: urlhelper.GetQueryInt64(qs, "id"),
}
err := validator.ValidateNonRequired(um)
if loggerdataresp.BadDataErrorResp(w, err, http.StatusBadRequest) {
return
}
_, err = services.GetDB().GetUpdateManifests().Delete(&um)
if loggerdataresp.BadDataErrorResp(w, err, http.StatusServiceUnavailable, loggerdataresp.PostgresNoRowsErrorCheck) {
return
}
utils.RespJSON(w, http.StatusOK, common.JSONMessage{
Message: "Deleted",
})
}