2025-03-10 11:03:00 +00:00
|
|
|
package queryservice
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
|
)
|
|
|
|
|
|
2025-03-11 16:31:06 +00:00
|
|
|
func (s *Controllers) GetStatusByClientId(ctx echo.Context, id string) error {
|
|
|
|
|
status, err := s.svc.Client.GetStatusByExternalId(ctx.Request().Context(), id)
|
2025-03-10 11:03:00 +00:00
|
|
|
if err != nil {
|
|
|
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to find client: %s", err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ctx.JSON(http.StatusOK, ClientStatusBody{
|
2025-03-11 16:31:06 +00:00
|
|
|
Status: parseClientStatus(status),
|
2025-03-10 11:03:00 +00:00
|
|
|
})
|
|
|
|
|
}
|