hiling_go/api/BaseResponse.go

18 lines
277 B
Go
Raw Normal View History

2023-09-08 22:25:38 +07:00
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,
}
}