package handler

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func Success(c *gin.Context, data any) {
	c.JSON(http.StatusOK, gin.H{"data": data})
}

func SuccessMessage(c *gin.Context, message string, data any) {
	c.JSON(http.StatusOK, gin.H{
		"message": message,
		"data":    data,
	})
}

func Fail(c *gin.Context, status int, message string) {
	c.JSON(status, gin.H{"message": message})
}

func NotImplemented(endpoint string) gin.HandlerFunc {
	return func(c *gin.Context) {
		c.JSON(http.StatusNotImplemented, gin.H{
			"message":  "not implemented yet",
			"endpoint": endpoint,
		})
	}
}
