MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Index

Method Index

api/pkg/handlers/bulk_message_handler.go:64–76  ·  view source on GitHub ↗

Index fetches the bulk message order history. @Summary List bulk message orders @Description Fetches the last 10 bulk message order summaries for the authenticated user showing counts per status. @Security ApiKeyAuth @Tags BulkSMS @Accept json @Produce json @Success 20

(c fiber.Ctx)

Source from the content-addressed store, hash-verified

62// @Failure 500 {object} responses.InternalServerError
63// @Router /bulk-messages [get]
64func (h *BulkMessageHandler) Index(c fiber.Ctx) error {
65 ctx, span, ctxLogger := h.tracer.StartFromFiberCtxWithLogger(c, h.logger)
66 defer span.End()
67
68 orders, err := h.messageService.GetBulkMessages(ctx, h.userIDFomContext(c))
69 if err != nil {
70 msg := fmt.Sprintf("cannot fetch bulk messages for user [%s]", h.userIDFomContext(c))
71 ctxLogger.Error(stacktrace.Propagate(err, msg))
72 return h.responseInternalServerError(c)
73 }
74
75 return h.responseOK(c, fmt.Sprintf("fetched %d bulk %s", len(orders), h.pluralize("message", len(orders))), orders)
76}
77
78// Store sends bulk SMS messages from a CSV or Excel file.
79// @Summary Store bulk SMS file

Callers

nothing calls this directly

Calls 7

userIDFomContextMethod · 0.80
responseOKMethod · 0.80
pluralizeMethod · 0.80
GetBulkMessagesMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected