Documentation ¶
Index ¶
- func ErrString(data int, msg ...interface{}) string
- func SuccessString(data interface{}, msg ...interface{}) string
- type MsgEntity
- func (m *MsgEntity) AppendMsg(msg ...interface{}) *MsgEntity
- func (m *MsgEntity) IncCode(iCode int) *MsgEntity
- func (m *MsgEntity) IncData(iCode int) int
- func (m *MsgEntity) InsertMsg(msg ...interface{}) *MsgEntity
- func (m *MsgEntity) SetData(data interface{}) *MsgEntity
- func (m *MsgEntity) SetMsg(msg ...interface{}) *MsgEntity
- func (m *MsgEntity) ToStr() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SuccessString ¶
func SuccessString(data interface{}, msg ...interface{}) string
*
- 返回包含'正确信息'的结构体Json字符串
- @param data 码值|数据
- @param msg 描述信息
- @return 返回Json字符串
Types ¶
type MsgEntity ¶
type MsgEntity struct { Gsuccess bool `json:"success"` Gmsg string `json:"msg"` Gdata interface{} `json:"data"` }
消息结构体,用于方法间传递消息
func Success ¶
func Success(data interface{}, msg ...interface{}) *MsgEntity
*
- 构造消息结构体,返回包含'正确信息'的结构体
- @param data 码值|数据
- @param msg 描述信息
- @return 返回新创建的结构体
Click to show internal directories.
Click to hide internal directories.