diff --git a/api_responses/api_responses.go b/api_responses/api_responses.go index bd6d4deb858d79c65c59ca73c94defd3dcabaa4d..2138361dbda238d18db0b503e0aa228e71812b50 100644 --- a/api_responses/api_responses.go +++ b/api_responses/api_responses.go @@ -3,6 +3,7 @@ package api_responses import ( "encoding/json" "fmt" + "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/date_utils" "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/errors" "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/map_utils" "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/string_utils" @@ -291,3 +292,12 @@ func GenericJSONResponseWithMessage(code int, err error) events.APIGatewayProxyR Headers: map_utils.MergeMaps(utils.CorsHeaders(), ContentTypeJSONHeader), } } + +func TimeResponse() events.APIGatewayProxyResponse { + currentTime, _ := json.Marshal(date_utils.CurrentDate()) + return events.APIGatewayProxyResponse{ + StatusCode: http.StatusOK, + Body: string(currentTime), + Headers: map_utils.MergeMaps(utils.CorsHeaders(), ContentTypeJSONHeader), + } +}