37 Star 409 Fork 125

联犀/物联网iot模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
assemble.go 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 2024-10-10 22:13 . feat: 更新mod
package devicemsglogic
import (
"gitee.com/unitedrhino/things/service/dmsvr/internal/domain/deviceLog"
"gitee.com/unitedrhino/things/service/dmsvr/pb/dm"
)
func ToDataHubLogIndex(log *deviceLog.Hub) *dm.HubLogInfo {
return &dm.HubLogInfo{
Timestamp: log.Timestamp.UnixMilli(),
Action: log.Action,
RequestID: log.RequestID,
TraceID: log.TraceID,
Topic: log.Topic,
Content: log.Content,
ResultCode: log.ResultCode,
RespPayload: log.RespPayload,
}
}
func ToDataSendLogIndex(log *deviceLog.Send) *dm.SendLogInfo {
return &dm.SendLogInfo{
Timestamp: log.Timestamp.UnixMilli(),
Account: log.Account,
UserID: log.UserID,
ProductID: log.ProductID,
DeviceName: log.DeviceName,
Action: log.Action,
DataID: log.DataID,
TraceID: log.TraceID,
Content: log.Content,
ResultCode: log.ResultCode,
}
}
func ToDataStatusLogIndex(log *deviceLog.Status) *dm.StatusLogInfo {
return &dm.StatusLogInfo{
Timestamp: log.Timestamp.UnixMilli(),
Status: log.Status,
ProductID: log.ProductID,
DeviceName: log.DeviceName,
}
}
// SDK调试日志
func ToDataSdkLogIndex(log *deviceLog.SDK) *dm.SdkLogInfo {
return &dm.SdkLogInfo{
Timestamp: log.Timestamp.UnixMilli(),
Loglevel: log.LogLevel,
Content: log.Content,
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/things.git
git@gitee.com:unitedrhino/things.git
unitedrhino
things
物联网iot模块
v1.0.0

搜索帮助