Add endpoint for all messages

This commit is contained in:
Ramiro Paz
2026-05-12 13:27:13 -03:00
parent 6e46fde5d2
commit 4270284362
9 changed files with 171 additions and 112 deletions

View File

@ -328,6 +328,30 @@ func (cont *Controller) GetLogs(ctx *gin.Context) {
ctx.JSON(http.StatusOK, logs)
}
// AllMessages godoc
// @Summary List all FIX application messages of the day
// @Description Returns every FIX application message recorded today (no admin: heartbeats/logon/logout/etc.), sorted by CreatedAt ascending
// @Tags fix
// @Produce json
// @Success 200 {array} domain.Message
// @Router /qfixdpl/v1/messages [post]
func (cont *Controller) AllMessages(ctx *gin.Context) {
setHeaders(ctx, cont.config)
var req AllMessagesRequest
if err := ctx.ShouldBindJSON(&req); err != nil {
ctx.JSON(http.StatusBadRequest, HTTPError{Error: err.Error()})
return
}
if req.APIKey != "1234" {
ctx.JSON(http.StatusUnauthorized, HTTPError{Error: "Not allowed to perform this request"})
return
}
ctx.JSON(http.StatusOK, cont.tradeProvider.GetAllMessages())
}
// GetPendingQuoteRequests godoc
// @Summary List pending QuoteRequests
// @Description Returns all QuoteRequests received from TW that have not been quoted yet by the dealer
@ -381,4 +405,3 @@ func (cont *Controller) SendQuote(ctx *gin.Context) {
ctx.JSON(http.StatusOK, Msg{Text: "Quote sent"})
}