feat(worker): lab5 add retries, DLQ registry and manual replay endpoint

This commit is contained in:
Голиков Maximillian Антон
2026-11-10 19:08:15 +03:00
parent dce767a156
commit f748c09e10
7 changed files with 84 additions and 0 deletions
@@ -92,3 +92,20 @@ func (h *AttachmentHandler) Content(c *gin.Context) {
c.DataFromReader(http.StatusOK, size, contentType, rc, nil)
}
func (h *AttachmentHandler) Replay(c *gin.Context) {
me := middleware.CurrentUser(c)
attachmentID, err := parseUUIDPathParam(c, "attachment_id")
if err != nil {
respondError(c, err)
return
}
if err := h.svc.Replay(c.Request.Context(), me.ID, attachmentID); err != nil {
respondError(c, err)
return
}
c.Status(http.StatusAccepted)
}
+1
View File
@@ -50,6 +50,7 @@ func NewRouter(h Handlers, auth gin.HandlerFunc) *gin.Engine {
protected.POST("/chats/:chat_id/attachments", h.Attachment.Upload)
protected.GET("/attachments/:attachment_id", h.Attachment.Get)
protected.GET("/attachments/:attachment_id/content", h.Attachment.Content)
protected.POST("/attachments/:attachment_id/replay", h.Attachment.Replay)
}
}