add route

This commit is contained in:
2026-03-26 02:23:36 +07:00
parent 9f9ffaa55f
commit 0a6294a62f
12 changed files with 864 additions and 22 deletions
+12 -2
View File
@@ -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)
}