This commit is contained in:
XM-GO
2023-08-22 15:17:14 +08:00
parent 85f4f328f4
commit 4344771547
143 changed files with 13004 additions and 6957 deletions

View File

@@ -0,0 +1,42 @@
package entity
import (
"pandax/pkg/global"
"time"
)
type RuleChainBaseLabel struct {
Id string `json:"id"`
Root string `json:"root"`
RuleName string `json:"ruleName"`
}
type RuleChainBase struct {
global.BaseAuthModel
Root string `json:"root" gorm:"comment:是否根节点,1 根链 0 普通链"`
RuleName string `gorm:"ruleName;type:varchar(50);comment:名称" json:"ruleName"`
RuleBase64 string `gorm:"ruleBase64;type:longtext;comment:Base64缩略图" json:"ruleBase64"` //缩略图 base64
RuleRemark string `gorm:"ruleRemark;type:varchar(256);comment:说明" json:"ruleRemark"`
}
type RuleChain struct {
RuleChainBase
RuleDataJson string `gorm:"ruleDataJson;type:longtext;comment:Json数据" json:"ruleDataJson"`
}
func (RuleChain) TableName() string {
return "rule_chain"
}
type RuleChainMsgLog struct {
MessageId string `json:"message_id"`
MsgType string `json:"msg_type"`
DeviceName string `json:"device_name"`
Ts time.Time `json:"ts"`
Content string `json:"content"`
CreatedAt time.Time // 创建时间
}
func (RuleChainMsgLog) TableName() string {
return "rule_chain_msg_log"
}

View 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)
}