@Summary Enqueue packacing job @Description Enqueue packaging job using input URL, format and ID @Produce json @Param id query string true "Input ID" @Success 201 {object} api.SuccessResponse @Failure 400 {object} api.ErrorResponse "Invalid UUID format" @Failure 500 {object} api.ErrorResponse "Inter
(ctx *gin.Context)
| 187 | // @Failure 500 {object} api.ErrorResponse "Internal server error" |
| 188 | // @Router /notifications/package [post] |
| 189 | func (n *NotificationController) EnqueuePackaging(ctx *gin.Context) { |
| 190 | id, err := uuid.Parse(ctx.Query("id")) |
| 191 | if err != nil { |
| 192 | ctx.JSON(http.StatusBadRequest, ErrorResponse{ |
| 193 | Error: Error{Message: "Invalid UUID format"}, |
| 194 | }) |
| 195 | |
| 196 | return |
| 197 | } |
| 198 | |
| 199 | if err := n.notificationHandler.PackageStream(ctx, id); err != nil { |
| 200 | ctx.JSON(http.StatusInternalServerError, ErrorResponse{ |
| 201 | Error: Error{Message: "InternalServerError: while creating input"}, |
| 202 | }) |
| 203 | |
| 204 | return |
| 205 | } |
| 206 | |
| 207 | ctx.JSON(http.StatusCreated, SuccessResponse{ |
| 208 | Message: "Packaging job enqueued successfully", |
| 209 | }) |
| 210 | } |
| 211 | |
| 212 | func NewOriginController(oh service.OriginHandler) *OriginController { |
| 213 | return &OriginController{originHandler: oh} |
nothing calls this directly
no test coverage detected