chore: 并入 iotlcm-upstream-chan 历史到 upstream-chan/(原提交 1e74497)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package infopb
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.5iot.com/iotlcm-public/iotlcm-upstream-chan/internal/pb"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-upstream-chan/internal/pub/xjpubservice"
|
||||
|
||||
"github.com/gogf/gf/contrib/rpc/grpcx/v2"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type Controller struct {
|
||||
pb.UnimplementedInfoServer
|
||||
}
|
||||
|
||||
func Register(s *grpcx.GrpcServer) {
|
||||
pb.RegisterInfoServer(s.Server, &Controller{})
|
||||
}
|
||||
|
||||
func (*Controller) Info(ctx context.Context, req *pb.InfoReq) (*pb.InfoRes, error) {
|
||||
g.Log().Info(ctx, req)
|
||||
info := xjpubservice.InfoRpc().GetInfo()
|
||||
return &pb.InfoRes{
|
||||
Head: &pb.HeadRes{
|
||||
Code: 0,
|
||||
Message: "success",
|
||||
},
|
||||
Type: info.Type,
|
||||
Name: info.Name,
|
||||
Title: info.Title,
|
||||
Description: info.Description,
|
||||
Version: info.Version,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user