package response // 数据集 type Msg struct { RequestId string `json:"requestId,omitempty"` Code int32 `json:"code,omitempty"` Msg string `json:"msg,omitempty"` Status string `json:"status,omitempty"` } type Response struct { Msg Data interface{} `json:"data"` } type page struct { Count int `json:"count"` //总数 Page int `json:"page"` //页码 PageSize int `json:"pageSize"` //页条数 } type Data struct { page List interface{} `json:"list"` } type Page struct { Msg Data Data `json:"data"` } func (e *Msg) SetTraceID(id string) { e.RequestId = id } func (e *Msg) SetMsg(s string) { e.Msg = s } func (e *Msg) SetCode(code int32) { e.Code = code } func (e *Msg) SetSuccess(success bool) { if !success { e.Status = "error" } }