Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fee2381a45 | ||
![]() |
a92a4d9fde | ||
3a243546e9 | |||
d6d5466597 |
@@ -1,7 +1,14 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
type Data struct {
|
type Data struct {
|
||||||
Action string `json:"action"`
|
Action string `json:"action,omitempty"`
|
||||||
Topic string `json:"topic"`
|
Topic string `json:"topic"`
|
||||||
Data any `json:"data"`
|
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