Files

26 lines
385 B
Go
Raw Permalink Normal View History

2023-12-30 17:40:20 +08:00
package app
import (
"github.com/gin-gonic/gin"
"net/http"
)
type Gin struct {
C *gin.Context
}
type Response struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
func (g *Gin) CResponse(errCode int, Msg string, data interface{}) {
g.C.JSON(http.StatusOK, Response{
Code: errCode,
Msg: Msg,
Data: data,
})
return
}