package response

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

type Body struct {
	Code      int    `json:"code"`
	Message   string `json:"message"`
	Data      any    `json:"data"`
	RequestID string `json:"requestId,omitempty"`
}

func body(c *gin.Context, code int, message string, data any) Body {
	requestID, _ := c.Get("requestID")
	value, _ := requestID.(string)
	return Body{Code: code, Message: message, Data: data, RequestID: value}
}
