Compare commits
2 Commits
3a243546e9
...
fee2381a45
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fee2381a45 | ||
![]() |
a92a4d9fde |
@@ -1,7 +1,14 @@
|
||||
package models
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type Data struct {
|
||||
Action string `json:"action,omitempty"`
|
||||
Topic string `json:"topic"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
func (*Data) ReadData(data []byte) (request Data, err error) {
|
||||
err = json.Unmarshal(data, &request)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user