mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-04 21:55:48 +08:00
refactor: 系统消息调整
This commit is contained in:
@@ -16,31 +16,3 @@ type Msg struct {
|
||||
|
||||
Type MsgType // 消息类型
|
||||
}
|
||||
|
||||
// ************** 系统消息 **************
|
||||
|
||||
const SuccessSysMsgType = 1
|
||||
const ErrorSysMsgType = 0
|
||||
const InfoSysMsgType = 2
|
||||
|
||||
// websocket消息
|
||||
type SysMsg struct {
|
||||
Type int `json:"type"` // 消息类型
|
||||
Title string `json:"title"` // 消息标题
|
||||
SysMsg string `json:"msg"` // 消息内容
|
||||
}
|
||||
|
||||
// 普通消息
|
||||
func NewSysMsg(title, msg string) *SysMsg {
|
||||
return &SysMsg{Type: InfoSysMsgType, Title: title, SysMsg: msg}
|
||||
}
|
||||
|
||||
// 成功消息
|
||||
func SuccessSysMsg(title, msg string) *SysMsg {
|
||||
return &SysMsg{Type: SuccessSysMsgType, Title: title, SysMsg: msg}
|
||||
}
|
||||
|
||||
// 错误消息
|
||||
func ErrSysMsg(title, msg string) *SysMsg {
|
||||
return &SysMsg{Type: ErrorSysMsgType, Title: title, SysMsg: msg}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user