2021-11-08 11:09:27 +08:00
|
|
|
package handle
|
|
|
|
|
|
|
|
import "encoding/json"
|
|
|
|
|
|
|
|
type WorkNotice struct {
|
|
|
|
Prefix string `json:"prefix"`
|
2021-11-18 09:51:39 +08:00
|
|
|
Data interface{} `json:"data"`
|
|
|
|
Message string `json:"message"`
|
2021-11-08 11:09:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *WorkNotice) ToBytes() []byte {
|
|
|
|
out, _ := json.Marshal(this)
|
|
|
|
return out
|
|
|
|
}
|
|
|
|
|
2021-11-18 09:51:39 +08:00
|
|
|
func NewWorkNotice(msg string, data interface{}) *WorkNotice {
|
2021-11-08 11:09:27 +08:00
|
|
|
return &WorkNotice{
|
|
|
|
Prefix: "work",
|
|
|
|
Message: msg,
|
2021-11-18 09:51:39 +08:00
|
|
|
Data: data,
|
2021-11-08 11:09:27 +08:00
|
|
|
}
|
|
|
|
}
|