package service import ( "context" "fmt" "time" "bkb-notify/api" "bkb-notify/internal/biz" "bkb-notify/internal/conf" "google.golang.org/protobuf/types/known/emptypb" ) // GreeterService is a greeter service. type GreeterService struct { api.UnimplementedGreeterServer uc *biz.GreeterUsecase email *conf.App_Email } // NewGreeterService new a greeter service. func NewGreeterService(uc *biz.GreeterUsecase,app *conf.App) *GreeterService { return &GreeterService{uc: uc,email: app.Email} } // SayHello implements helloworld.GreeterServer. func (s *GreeterService) Ping(ctx context.Context, in *emptypb.Empty) (*api.PingReply, error) { msg := "It takes two!" ts := time.Now().Format("2006-01-02 15:04:05") rs := fmt.Sprintf("%s%s", msg, ts) return &api.PingReply{Message: rs}, nil }