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
Binary file not shown.
+11 -2
View File
@@ -9,6 +9,7 @@ import (
"pinned_message/internal/config"
"pinned_message/internal/modules/data_parser"
"pinned_message/internal/modules/date_parser"
"pinned_message/internal/services"
"pinned_message/internal/services/schedule_parser"
"pinned_message/internal/services/schedule_storage"
proto "pinned_message/proto"
@@ -29,17 +30,25 @@ func main() {
s := grpc.NewServer()
ctx := context.Background()
scheduleStorage := schedule_storage.NewScheduleStorage(config.GetScheduleFilepath())
scheduleParser := schedule_parser.NewScheduleParser(
data_parser.NewGoogleTableScheduleParser(),
date_parser.NewDateParser(),
*schedule_storage.NewScheduleStorage(config.GetScheduleFilepath()),
scheduleStorage,
)
go func() {
scheduleParser.Run(ctx)
}()
// Attach the Greeter service to the server
proto.RegisterPinnedMessageServer(s, app.NewServer())
proto.RegisterPinnedMessageServer(
s,
app.NewServer(
services.NewServices(
scheduleStorage,
),
),
)
// Serve gRPC server
log.Println("Serving gRPC on 0.0.0.0:8080")
go func() {