diff --git a/internals/handlers/history_handlers.go b/internals/handlers/history_handlers.go index 2f22d584..d478c810 100644 --- a/internals/handlers/history_handlers.go +++ b/internals/handlers/history_handlers.go @@ -11,18 +11,12 @@ import ( // @Summary Get Today's Fact Result by Criteria // @Description Fetches the result of a historical fact based on provided criteria for today's date. -// @Description Example Request: -// @Description
{ -// @Description "factID": 123, -// @Description "situationId": 456, -// @Description "situationInstanceId": 789 -// @Description }// @Tags Facts_history // @Accept json // @Produce json -// @Param history.ParamGetFactHistory body interface{} true "JSON payload containing criteria for fetching today's history fact result." +// @Param factHistory body history.ParamGetFactHistory true "JSON payload containing criteria for fetching today's history fact result." // @Security Bearer -// @Success 200 "Successfully fetched result" +// @Success 200 {object} history.FactResult "Successfully fetched result" // @Failure 400 "Status Bad Request" // @Failure 500 "Status" internal server error" // @Router /engine/history/facts/today/result [post] @@ -55,21 +49,13 @@ func GetFactResultForTodayByCriteria(w http.ResponseWriter, r *http.Request) { // @Summary Get Fact Result by Date Criteria // @Description Fetches the result of a historical fact based on provided criteria within specified date range. -// @Description Example Request: -// @Description
{ -// @Description "factID": 42, -// @Description "situationId": 29, -// @Description "situationInstanceId": 572, -// @Description "startDate": "2023-01-01 00:00:00", -// @Description "endDate": "2023-12-30 00:00:00" -// @Description }// The dates should be in the format "2006-01-02 15:04:05". // @Tags Facts_history // @Accept json // @Produce json -// @Param history.ParamGetFactHistoryByDate body interface{} true "JSON payload containing criteria and date range for fetching history fact result, with dates in '2006-01-02 15:04:05' format." +// @Param factHistory body history.ParamGetFactHistoryByDate true "JSON payload containing criteria and date range for fetching history fact result, with dates in '2006-01-02 15:04:05' format." // @Security Bearer -// @Success 200 "Successfully fetched result" +// @Success 200 {object} history.FactResult "Successfully fetched result" // @Failure 400 "Status Bad Request" // @Failure 500 "Status Internal Server Error" // @Router /engine/history/facts/date/result [post] diff --git a/internals/history/fact_history_querier.go b/internals/history/fact_history_querier.go index 6662b064..994fda02 100644 --- a/internals/history/fact_history_querier.go +++ b/internals/history/fact_history_querier.go @@ -33,7 +33,7 @@ type GetFactHistory struct { type FactResult struct { Value int64 `json:"value"` - FormattedTime string `json:"formattedTime"` + FormattedTime string `json:"formattedTime" example:"2006-01-02 15:04:05"` } type ParamGetFactHistory struct {