mirror of
https://github.com/wonli/aqi.git
synced 2025-12-24 10:40:58 +08:00
28 lines
376 B
Go
28 lines
376 B
Go
package ws
|
|
|
|
func New(action string) *Action {
|
|
return &Action{
|
|
Action: action,
|
|
}
|
|
}
|
|
|
|
func (m *Action) WithId(id string) *Action {
|
|
m.Id = id
|
|
return m
|
|
}
|
|
|
|
func (m *Action) WithCode(code int) *Action {
|
|
m.Code = code
|
|
return m
|
|
}
|
|
|
|
func (m *Action) WithData(data any) *Action {
|
|
m.Data = data
|
|
return m
|
|
}
|
|
|
|
func (m *Action) WithMsg(msg string) *Action {
|
|
m.Msg = msg
|
|
return m
|
|
}
|