Documentation ¶ Index ¶ func IP(c *gin.Context) string func Init() gin.HandlerFunc type Response type Result func NewResult(ctx *gin.Context) *Result func (r *Result) Error(response Response) func (r *Result) Json(code int, obj interface{}) func (r *Result) Success(response Response) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func IP ¶ func IP(c *gin.Context) string func Init ¶ func Init() gin.HandlerFunc Types ¶ type Response ¶ type Response struct { Code int `json:"code"` // 错误码 Data interface{} `json:"data"` // 数据 Message string `json:"message"` // 提示信息 } type Result ¶ type Result struct { Ctx *gin.Context } var ApiResponse *Result func NewResult ¶ func NewResult(ctx *gin.Context) *Result func (*Result) Error ¶ func (r *Result) Error(response Response) func (*Result) Json ¶ func (r *Result) Json(code int, obj interface{}) func (*Result) Success ¶ func (r *Result) Success(response Response) Source Files ¶ View all Source files result.go Click to show internal directories. Click to hide internal directories.