12345678910111213141516171819202122232425262728293031 |
- // Copyright 2019 getensh.com. All rights reserved.
- // Use of this source code is governed by getensh.com.
- package impl
- import (
- "context"
- "adm-data/impl/v1/query"
- "adm-data/pb"
- v1 "adm-data/pb/v1"
- "git.getensh.com/common/gopkgsv2/tasker/rpctasker"
- "google.golang.org/grpc"
- )
- // 具体实现
- type Rcvr struct{}
- func Register(s *grpc.Server) {
- pb.RegisterDataServer(s, &Rcvr{})
- }
- func (c *Rcvr) Query(ctx context.Context, req *v1.QueryRequest) (reply *v1.QueryResponse, err error) {
- t1 := func() error {
- reply, err = query.Query(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
|