diff --git a/cmd/server/main.go b/cmd/server/main.go index 0695775..b9ec71f 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -5,14 +5,18 @@ import ( "app/internal/pkg" gossiper "github.com/pieceowater-dev/lotof.lib.gossiper/v2" "google.golang.org/grpc" + "google.golang.org/grpc/reflection" ) func main() { appCfg := cfg.Inst() appRouter := pkg.NewRouter() + grpcServer := grpc.NewServer() + reflection.Register(grpcServer) + serverManager := gossiper.NewServerManager() - serverManager.AddServer(gossiper.NewGRPCServ(appCfg.GrpcPort, grpc.NewServer(), appRouter.InitGRPC)) + serverManager.AddServer(gossiper.NewGRPCServ(appCfg.GrpcPort, grpcServer, appRouter.InitGRPC)) serverManager.StartAll() defer serverManager.StopAll() diff --git a/internal/pkg/post/ctrl/post.ctrl.go b/internal/pkg/post/ctrl/post.ctrl.go index d462f6c..5dc90cd 100644 --- a/internal/pkg/post/ctrl/post.ctrl.go +++ b/internal/pkg/post/ctrl/post.ctrl.go @@ -3,6 +3,7 @@ package ctrl import ( pb "app/internal/core/grpc/generated" "app/internal/pkg/post/svc" + "context" ) type PostController struct { @@ -13,3 +14,23 @@ type PostController struct { func NewPostController(service *svc.PostService) *PostController { return &PostController{postService: service} } + +func (p PostController) GetPosts(ctx context.Context, request *pb.GetPostsRequest) (*pb.GetPostsResponse, error) { + //TODO implement me + panic("implement me") +} + +func (p PostController) GetPost(ctx context.Context, request *pb.GetPostRequest) (*pb.Post, error) { + //TODO implement me + panic("implement me") +} + +func (p PostController) CreatePost(ctx context.Context, request *pb.CreatePostRequest) (*pb.Post, error) { + //TODO implement me + panic("implement me") +} + +func (p PostController) DeletePost(ctx context.Context, request *pb.DeletePostRequest) (*pb.Post, error) { + //TODO implement me + panic("implement me") +} diff --git a/internal/pkg/post/svc/post.svc.go b/internal/pkg/post/svc/post.svc.go index 33b2f9c..6604fe3 100644 --- a/internal/pkg/post/svc/post.svc.go +++ b/internal/pkg/post/svc/post.svc.go @@ -1,6 +1,8 @@ package svc import ( + "app/internal/pkg/post/ent" + "context" gossiper "github.com/pieceowater-dev/lotof.lib.gossiper/v2" ) @@ -11,3 +13,23 @@ type PostService struct { func NewPostService(db gossiper.Database) *PostService { return &PostService{db: db} } + +func (s PostService) GetPosts(ctx context.Context, filter gossiper.Filter[string]) (gossiper.PaginatedResult[*ent.Post], error) { + //TODO implement me + panic("implement me") +} + +func (s PostService) GetPost(ctx context.Context, id int) (ent.Post, error) { + //TODO implement me + panic("implement me") +} + +func (s PostService) CreatePost(ctx context.Context, post *ent.Post) (ent.Post, error) { + //TODO implement me + panic("implement me") +} + +func (s PostService) DeletePost(ctx context.Context, id int) (ent.Post, error) { + //TODO implement me + panic("implement me") +} diff --git a/internal/pkg/record/ctrl/record.ctrl.go b/internal/pkg/record/ctrl/record.ctrl.go index 3fce754..8c0a108 100644 --- a/internal/pkg/record/ctrl/record.ctrl.go +++ b/internal/pkg/record/ctrl/record.ctrl.go @@ -3,6 +3,7 @@ package ctrl import ( pb "app/internal/core/grpc/generated" "app/internal/pkg/record/svc" + "context" ) type RecordController struct { @@ -13,3 +14,13 @@ type RecordController struct { func NewRecordController(service *svc.RecordService) *RecordController { return &RecordController{recordService: service} } + +func (r RecordController) GetRecords(ctx context.Context, request *pb.GetRecordsRequest) (*pb.GetRecordsResponse, error) { + //TODO implement me + panic("implement me") +} + +func (r RecordController) CreateRecord(ctx context.Context, request *pb.CreateRecordRequest) (*pb.Record, error) { + //TODO implement me + panic("implement me") +} diff --git a/internal/pkg/record/svc/record.svc.go b/internal/pkg/record/svc/record.svc.go index 253d19b..530acd6 100644 --- a/internal/pkg/record/svc/record.svc.go +++ b/internal/pkg/record/svc/record.svc.go @@ -1,6 +1,10 @@ package svc -import gossiper "github.com/pieceowater-dev/lotof.lib.gossiper/v2" +import ( + "app/internal/pkg/record/ent" + "context" + gossiper "github.com/pieceowater-dev/lotof.lib.gossiper/v2" +) type RecordService struct { db gossiper.Database @@ -9,3 +13,13 @@ type RecordService struct { func NewRecordService(db gossiper.Database) *RecordService { return &RecordService{db: db} } + +func (s RecordService) GetRecords(ctx context.Context, filter gossiper.Filter[string]) (gossiper.PaginatedResult[ent.Record], error) { + //TODO implement me + panic("implement me") +} + +func (s RecordService) CreateRecord(ctx context.Context, request *ent.Record) (*ent.Record, error) { + //TODO implement me + panic("implement me") +} diff --git a/internal/pkg/route/ctrl/route.ctrl.go b/internal/pkg/route/ctrl/route.ctrl.go index 16e6f26..a785298 100644 --- a/internal/pkg/route/ctrl/route.ctrl.go +++ b/internal/pkg/route/ctrl/route.ctrl.go @@ -3,6 +3,7 @@ package ctrl import ( pb "app/internal/core/grpc/generated" "app/internal/pkg/route/svc" + "context" ) type RouteController struct { @@ -13,3 +14,23 @@ type RouteController struct { func NewRouteController(service *svc.RouteService) *RouteController { return &RouteController{routeService: service} } + +func (r RouteController) GetRoutes(ctx context.Context, request *pb.GetRoutesRequest) (*pb.GetRoutesResponse, error) { + //TODO implement me + panic("implement me") +} + +func (r RouteController) GetRoute(ctx context.Context, request *pb.GetRouteRequest) (*pb.Route, error) { + //TODO implement me + panic("implement me") +} + +func (r RouteController) CreateRoute(ctx context.Context, request *pb.CreateRouteRequest) (*pb.Route, error) { + //TODO implement me + panic("implement me") +} + +func (r RouteController) DeleteRoute(ctx context.Context, request *pb.DeleteRouteRequest) (*pb.Route, error) { + //TODO implement me + panic("implement me") +} diff --git a/internal/pkg/route/svc/route.svc.go b/internal/pkg/route/svc/route.svc.go index 5ac0a2a..56cb573 100644 --- a/internal/pkg/route/svc/route.svc.go +++ b/internal/pkg/route/svc/route.svc.go @@ -1,6 +1,10 @@ package svc -import gossiper "github.com/pieceowater-dev/lotof.lib.gossiper/v2" +import ( + "app/internal/pkg/route/ent" + "context" + gossiper "github.com/pieceowater-dev/lotof.lib.gossiper/v2" +) type RouteService struct { db gossiper.Database @@ -9,3 +13,23 @@ type RouteService struct { func NewRouteService(db gossiper.Database) *RouteService { return &RouteService{db: db} } + +func (s RouteService) GetRoutes(ctx context.Context, filter gossiper.Filter[string]) (gossiper.PaginatedResult[ent.Route], error) { + //TODO implement me + panic("implement me") +} + +func (s RouteService) GetRoute(ctx context.Context, id int) (*ent.Route, error) { + //TODO implement me + panic("implement me") +} + +func (s RouteService) CreateRoute(ctx context.Context, request *ent.Route) (*ent.Route, error) { + //TODO implement me + panic("implement me") +} + +func (s RouteService) DeleteRoute(ctx context.Context, id int) (*ent.Route, error) { + //TODO implement me + panic("implement me") +}