20 lines
355 B
Go
20 lines
355 B
Go
package response
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Response(ctx *gin.Context, httpStatus int, data gin.H) {
|
|
ctx.HTML(httpStatus, "index.html", data)
|
|
}
|
|
|
|
func Success(ctx *gin.Context, data gin.H) {
|
|
Response(ctx, http.StatusOK, data)
|
|
}
|
|
|
|
func Fail(ctx *gin.Context, data gin.H) {
|
|
ctx.HTML(http.StatusNotFound, "404.html", data)
|
|
}
|