func Response(c *gin.Context, err error, data interface{}) {
	code, message := errcode.DecodeErr(err)
	c.JSON(http.StatusOK, Resp{
		Code:    code,
		Message: message,
		Data:    data,
	})
}
Response json response
package web
import (
	"net/http"
	"github.com/gin-gonic/gin"
	"github.com/gorilla/sessions"
	"github.com/spf13/viper"
	"github.com/go-eagle/eagle/pkg/conf"
	"github.com/go-eagle/eagle/pkg/errcode"
	"github.com/go-eagle/eagle/pkg/flash"
	"github.com/go-eagle/eagle/pkg/log"
)
type Resp struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}