add order service
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-05-27 03:21:47 +07:00
parent f2aedd7a98
commit 820306f654
3 changed files with 66 additions and 44 deletions
+4 -1
View File
@@ -5,6 +5,7 @@ import (
"cake_crm/internal/modules/messenger/telegram"
"cake_crm/internal/modules/storage/storage_file"
"cake_crm/internal/services/card"
"cake_crm/internal/services/order"
proto "cake_crm/proto"
"context"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
@@ -23,6 +24,8 @@ func main() {
cardService := card.NewService(storage)
orderService := order.NewService()
tokenData, err := os.ReadFile("resources/order_bot_token.txt")
if err != nil {
panic(err)
@@ -52,7 +55,7 @@ func main() {
// Create a gRPC server object
s := grpc.NewServer()
// Attach the Greeter service to the server
proto.RegisterCRMServer(s, app.NewServer(storage, messenger, cardService))
proto.RegisterCRMServer(s, app.NewServer(storage, messenger, cardService, orderService))
// Serve gRPC server
log.Println("Serving gRPC on 0.0.0.0:8080")
go func() {