hiling_go/api/BaseResponse.go
2023-09-12 17:08:17 +07:00

18 lines
277 B
Go

package api
import "github.com/gin-gonic/gin"
func ErrorResponse(err error, msg string) gin.H {
return gin.H{
"error": err.Error(),
"message": msg,
}
}
func ValidResponse(data interface{}, msg string) gin.H {
return gin.H{
"message": msg,
"data": data,
}
}