hiling_go/api/BaseResponse.go

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,
}
}