response_bean.go 523 字节
package result

type ResponseSuccessBean struct {
	Code uint32      `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}
type NullJson struct{}

func Success(data interface{}) *ResponseSuccessBean {
	return &ResponseSuccessBean{Code: 0, Msg: "OK", Data: data}
}

type ResponseErrorBean struct {
	Code  int    `json:"code"`
	Msg   string `json:"msg"`
	Error string `json:"err"`
}

func Error(errCode int, errMsg string) *ResponseErrorBean {
	return &ResponseErrorBean{Code: errCode, Msg: errMsg}
}