InitRestNewsletter (rest/newsletter.go)

go-whatsapp-web-multidevice · src/ui/rest/newsletter.go · go · MIT
email

REST API for newsletter operations using Fiber, exposing endpoints for unfollow, messages, and media download.

// Source: https://github.com/aldinokemal/go-whatsapp-web-multidevice | License: MIT
// Provided via justclaw.it.com; keep this notice with the code.
package rest

import (
	"strconv"

	domainNewsletter "github.com/aldinokemal/go-whatsapp-web-multidevice/domains/newsletter"
	"github.com/aldinokemal/go-whatsapp-web-multidevice/infrastructure/whatsapp"
	pkgError "github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/error"
	"github.com/aldinokemal/go-whatsapp-web-multidevice/pkg/utils"
	"github.com/gofiber/fiber/v3"
)

type Newsletter struct {
	Service domainNewsletter.INewsletterUsecase
}

func InitRestNewsletter(app fiber.Router, service domainNewsletter.INewsletterUsecase) Newsletter {
	rest := Newsletter{Service: service}
	app.Post("/newsletter/unfollow", rest.Unfollow)
	app.Get("/newsl

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key