12345678910111213141516171819202122 |
- package httper
- import (
- "encoding/json"
- "github.com/astaxie/beego/context"
- "go.uber.org/zap"
- )
- func JSON(ctx *context.Context, param interface{}, logID string) {
- if ctx == nil {
- return
- }
- ctx.Output.JSON(param, false, false)
- if Debug && DebugLog != nil {
- data, _ := json.Marshal(param)
- DebugLog.Debug(logID, zap.String("response", string(data)))
- }
- }
|