2023-09-08 22:25:38 +07:00
|
|
|
package api
|
|
|
|
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
|
2023-09-12 17:08:17 +07:00
|
|
|
func ErrorResponse(err error, msg string) gin.H {
|
2023-09-08 22:25:38 +07:00
|
|
|
return gin.H{
|
|
|
|
"error": err.Error(),
|
|
|
|
"message": msg,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-12 17:08:17 +07:00
|
|
|
func ValidResponse(data interface{}, msg string) gin.H {
|
2023-09-08 22:25:38 +07:00
|
|
|
return gin.H{
|
|
|
|
"message": msg,
|
|
|
|
"data": data,
|
|
|
|
}
|
|
|
|
}
|