package web

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

type apiResp struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data,omitempty"`
}

func respondOK(c *gin.Context, message string, data any) {
	c.JSON(200, apiResp{Code: "OK", Message: message, Data: data})
}

func respondErr(c *gin.Context, status int, code, message string) {
	c.JSON(status, apiResp{Code: code, Message: message})
}
