bilibili-backup/app/tool/protoc-gen-bm/examples/helloworld/service/service.go
2019-04-22 02:59:20 +00:00

27 lines
557 B
Go

package service
import (
"context"
"fmt"
"go-common/app/tool/protoc-gen-bm/examples/helloworld/api"
)
// Service .
type Service struct{}
var _ v1.HelloServer = &Service{}
var _ v1.BMHelloServer = &Service{}
// SayHello .
func (s *Service) SayHello(ctx context.Context, req *v1.HelloRequest) (*v1.HelloReply, error) {
return &v1.HelloReply{
Message: fmt.Sprintf("hello %s", req.Name),
}, nil
}
// Echo .
func (s *Service) Echo(ctx context.Context, req *v1.EchoRequest) (*v1.EchoReply, error) {
return &v1.EchoReply{Content: req.Content}, nil
}