mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: code review
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package dto
|
||||
|
||||
import "mayfly-go/pkg/utils/stringx"
|
||||
import "mayfly-go/pkg/utils/anyx"
|
||||
|
||||
// ************** 系统消息 **************
|
||||
|
||||
@@ -29,7 +29,7 @@ func (sm *SysMsg) WithCategory(category string) *SysMsg {
|
||||
}
|
||||
|
||||
func (sm *SysMsg) WithMsg(msg any) *SysMsg {
|
||||
sm.Msg = stringx.AnyToStr(msg)
|
||||
sm.Msg = anyx.ToString(msg)
|
||||
return sm
|
||||
}
|
||||
|
||||
@@ -40,15 +40,15 @@ func (sm *SysMsg) WithClientId(clientId string) *SysMsg {
|
||||
|
||||
// 普通消息
|
||||
func InfoSysMsg(title string, msg any) *SysMsg {
|
||||
return &SysMsg{Type: InfoSysMsgType, Title: title, Msg: stringx.AnyToStr(msg)}
|
||||
return &SysMsg{Type: InfoSysMsgType, Title: title, Msg: anyx.ToString(msg)}
|
||||
}
|
||||
|
||||
// 成功消息
|
||||
func SuccessSysMsg(title string, msg any) *SysMsg {
|
||||
return &SysMsg{Type: SuccessSysMsgType, Title: title, Msg: stringx.AnyToStr(msg)}
|
||||
return &SysMsg{Type: SuccessSysMsgType, Title: title, Msg: anyx.ToString(msg)}
|
||||
}
|
||||
|
||||
// 错误消息
|
||||
func ErrSysMsg(title string, msg any) *SysMsg {
|
||||
return &SysMsg{Type: ErrorSysMsgType, Title: title, Msg: stringx.AnyToStr(msg)}
|
||||
return &SysMsg{Type: ErrorSysMsgType, Title: title, Msg: anyx.ToString(msg)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user