39 Star 451 Fork 136

联犀/物联网iot模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
readLogic.go 814 Bytes
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 1个月前 . feat: 添加协议脚本
package script
import (
"context"
"gitee.com/unitedrhino/share/utils"
"gitee.com/unitedrhino/things/service/dmsvr/pb/dm"
"gitee.com/unitedrhino/things/service/apisvr/internal/svc"
"gitee.com/unitedrhino/things/service/apisvr/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type ReadLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
// 获取协议插件详情
func NewReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ReadLogic {
return &ReadLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ReadLogic) Read(req *types.WithIDStr) (resp *types.ProtocolScript, err error) {
ret, err := l.svcCtx.ProtocolM.ProtocolScriptRead(l.ctx, utils.Copy[dm.WithID](req))
return utils.Copy[types.ProtocolScript](ret), err
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/things.git
git@gitee.com:unitedrhino/things.git
unitedrhino
things
物联网iot模块
v1.3.5

搜索帮助

371d5123 14472233 46e8bd33 14472233