// Package handler provides HTTP handlers for various endpoints. package handler import ( "net/http" "modelRT/network" "github.com/gin-gonic/gin" ) func renderFailure(c *gin.Context, code int, msg string, payload any) { resp := network.FailureResponse{ Code: code, Msg: msg, } if payload != nil { resp.Payload = payload } c.JSON(http.StatusOK, resp) } func renderRespSuccess(c *gin.Context, code int, msg string, payload any) { resp := network.SuccessResponse{ Code: code, Msg: msg, } if payload != nil { resp.Payload = payload } c.JSON(http.StatusOK, resp) }