Add endpoint for all messages
This commit is contained in:
@ -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"})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user