generated from VLADIMIR/template
add route
This commit is contained in:
+12
-2
@@ -2,17 +2,27 @@ package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"pinned_message/internal/services"
|
||||
proto "pinned_message/proto"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
proto.UnimplementedPinnedMessageServer
|
||||
services *services.Services
|
||||
}
|
||||
|
||||
func NewServer() *Server {
|
||||
return &Server{}
|
||||
func NewServer(
|
||||
services *services.Services,
|
||||
) *Server {
|
||||
return &Server{
|
||||
services: services,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) Ping(_ context.Context, _ *proto.PingReq) (*proto.PingRsp, error) {
|
||||
return &proto.PingRsp{}, nil
|
||||
}
|
||||
|
||||
func (s *Server) GetDays(ctx context.Context, req *proto.GetDaysReq) (*proto.GetDaysRsp, error) {
|
||||
return s.services.GetDays(ctx, req)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user