Files
ArmedPolice/app/handle/notice.go
2021-11-18 09:51:39 +08:00

23 lines
407 B
Go

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