20 lines
319 B
Go
20 lines
319 B
Go
package sample
|
|
|
|
import (
|
|
"context"
|
|
|
|
pb "myschools.me/suguo/consul-demo/proto"
|
|
)
|
|
|
|
//Server 微服务
|
|
type Server struct {
|
|
}
|
|
|
|
//Say 实现微服务接口
|
|
func (s *Server) Say(c context.Context, req *pb.SayRequest) (*pb.SayResponse, error) {
|
|
resp := &pb.SayResponse{
|
|
Reply: req.Name + req.Day,
|
|
}
|
|
return resp, nil
|
|
}
|