saas-smartAi通信协议标准库
gongshangguo
2022-03-02 cb8a046f1d84198b6bbddb1481667b905ea522bf
aiotProto/aiot/aiot_business.pb.micro.go
@@ -34,8 +34,14 @@
// Client API for AiotService service
type AiotService interface {
   GetBusiness(ctx context.Context, in *BusinessReq, opts ...client.CallOption) (*BusinessReply, error)
   // 发送指向单个设备的请求
   SendToNode(ctx context.Context, in *NodeReq, opts ...client.CallOption) (*BusinessReply, error)
   // 直接发送tcp请求
   SendAiotReq(ctx context.Context, in *Protocol, opts ...client.CallOption) (*Protocol, error)
   // 发送群组请求
   SendToCluster(ctx context.Context, in *ClusterReq, opts ...client.CallOption) (*BusinessReply, error)
   // 向多个设备同时发起相同参数请求
   SendToNodes(ctx context.Context, in *NodesReq, opts ...client.CallOption) (*BusinessReply, error)
}
type aiotService struct {
@@ -56,8 +62,8 @@
   }
}
func (c *aiotService) GetBusiness(ctx context.Context, in *BusinessReq, opts ...client.CallOption) (*BusinessReply, error) {
   req := c.c.NewRequest(c.name, "AiotService.GetBusiness", in)
func (c *aiotService) SendToNode(ctx context.Context, in *NodeReq, opts ...client.CallOption) (*BusinessReply, error) {
   req := c.c.NewRequest(c.name, "AiotService.SendToNode", in)
   out := new(BusinessReply)
   err := c.c.Call(ctx, req, out, opts...)
   if err != nil {
@@ -76,17 +82,45 @@
   return out, nil
}
func (c *aiotService) SendToCluster(ctx context.Context, in *ClusterReq, opts ...client.CallOption) (*BusinessReply, error) {
   req := c.c.NewRequest(c.name, "AiotService.SendToCluster", in)
   out := new(BusinessReply)
   err := c.c.Call(ctx, req, out, opts...)
   if err != nil {
      return nil, err
   }
   return out, nil
}
func (c *aiotService) SendToNodes(ctx context.Context, in *NodesReq, opts ...client.CallOption) (*BusinessReply, error) {
   req := c.c.NewRequest(c.name, "AiotService.SendToNodes", in)
   out := new(BusinessReply)
   err := c.c.Call(ctx, req, out, opts...)
   if err != nil {
      return nil, err
   }
   return out, nil
}
// Server API for AiotService service
type AiotServiceHandler interface {
   GetBusiness(context.Context, *BusinessReq, *BusinessReply) error
   // 发送指向单个设备的请求
   SendToNode(context.Context, *NodeReq, *BusinessReply) error
   // 直接发送tcp请求
   SendAiotReq(context.Context, *Protocol, *Protocol) error
   // 发送群组请求
   SendToCluster(context.Context, *ClusterReq, *BusinessReply) error
   // 向多个设备同时发起相同参数请求
   SendToNodes(context.Context, *NodesReq, *BusinessReply) error
}
func RegisterAiotServiceHandler(s server.Server, hdlr AiotServiceHandler, opts ...server.HandlerOption) error {
   type aiotService interface {
      GetBusiness(ctx context.Context, in *BusinessReq, out *BusinessReply) error
      SendToNode(ctx context.Context, in *NodeReq, out *BusinessReply) error
      SendAiotReq(ctx context.Context, in *Protocol, out *Protocol) error
      SendToCluster(ctx context.Context, in *ClusterReq, out *BusinessReply) error
      SendToNodes(ctx context.Context, in *NodesReq, out *BusinessReply) error
   }
   type AiotService struct {
      aiotService
@@ -99,10 +133,18 @@
   AiotServiceHandler
}
func (h *aiotServiceHandler) GetBusiness(ctx context.Context, in *BusinessReq, out *BusinessReply) error {
   return h.AiotServiceHandler.GetBusiness(ctx, in, out)
func (h *aiotServiceHandler) SendToNode(ctx context.Context, in *NodeReq, out *BusinessReply) error {
   return h.AiotServiceHandler.SendToNode(ctx, in, out)
}
func (h *aiotServiceHandler) SendAiotReq(ctx context.Context, in *Protocol, out *Protocol) error {
   return h.AiotServiceHandler.SendAiotReq(ctx, in, out)
}
func (h *aiotServiceHandler) SendToCluster(ctx context.Context, in *ClusterReq, out *BusinessReply) error {
   return h.AiotServiceHandler.SendToCluster(ctx, in, out)
}
func (h *aiotServiceHandler) SendToNodes(ctx context.Context, in *NodesReq, out *BusinessReply) error {
   return h.AiotServiceHandler.SendToNodes(ctx, in, out)
}