mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-24 03:18:35 +08:00
iot init
This commit is contained in:
24
apps/rule/entity/rulechain_data.go
Normal file
24
apps/rule/entity/rulechain_data.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type RuleDataJson struct {
|
||||
LfData struct {
|
||||
GlobalColor string `json:"globalColor"`
|
||||
DataCode map[string]interface{} `json:"dataCode"`
|
||||
OpenRule bool `json:"openRule"`
|
||||
Setting map[string]interface{} `json:"setting"`
|
||||
} `json:"lfData"`
|
||||
}
|
||||
|
||||
// 序列化
|
||||
func (m *RuleDataJson) MarshalBinary() (data []byte, err error) {
|
||||
return json.Marshal(m)
|
||||
}
|
||||
|
||||
// 反序列化
|
||||
func (m *RuleDataJson) UnmarshalBinary(data []byte) error {
|
||||
return json.Unmarshal(data, m)
|
||||
}
|
||||
Reference in New Issue
Block a user