21 lines
342 B
Go
21 lines
342 B
Go
![]() |
package handle
|
||
|
|
||
|
import "encoding/json"
|
||
|
|
||
|
type WorkNotice struct {
|
||
|
Prefix string `json:"prefix"`
|
||
|
Message interface{} `json:"message"`
|
||
|
}
|
||
|
|
||
|
func (this *WorkNotice) ToBytes() []byte {
|
||
|
out, _ := json.Marshal(this)
|
||
|
return out
|
||
|
}
|
||
|
|
||
|
func NewWorkNotice(msg interface{}) *WorkNotice {
|
||
|
return &WorkNotice{
|
||
|
Prefix: "work",
|
||
|
Message: msg,
|
||
|
}
|
||
|
}
|