package apiok type OkResponse struct { Code int `json:"code"` Msg string `json:"msg"` Result interface{} `json:"result"` } func CommonResponse(data interface{}) *OkResponse { return &OkResponse{ Code: 200, Msg: "ok", Result: data, } } type ApiOk struct { Success bool `json:"success"` } func NewApiOk(success bool) *ApiOk { return &ApiOk{Success: success} }