18 lines
277 B
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,
|
|
}
|
|
}
|