62886dbba8
Remove Job * removejob * rmjob * sync * cleanup * precommit * startslow * startslow * startslow * openapi * clean * test * scripts * littlecleanercmds * mermaid
22 lines
506 B
Go
22 lines
506 B
Go
package queryservice
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
"github.com/oapi-codegen/runtime/types"
|
|
)
|
|
|
|
func (s *Controllers) GetStatusByClientId(ctx echo.Context, id types.UUID) error {
|
|
status, err := s.svc.Client.GetStatus(ctx.Request().Context(), id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to find client: %s", err))
|
|
}
|
|
|
|
return ctx.JSON(http.StatusOK, ClientStatusBody{
|
|
ClientId: id,
|
|
Status: parseClientStatus(status),
|
|
})
|
|
}
|