packed.go 294 B

123456789101112131415161718
  1. package app
  2. import (
  3. "github.com/gogf/gf/v2/net/ghttp"
  4. )
  5. type Ghttp struct {
  6. C *ghttp.Request
  7. }
  8. func (g *Ghttp) Response(httpCode, errCode int, data interface{}) {
  9. g.C.Response.WriteJson(map[string]interface{}{
  10. "code": httpCode,
  11. "msg": GetMsg(errCode),
  12. "data": data,
  13. })
  14. return
  15. }