style: reformatted all files

This commit is contained in:
ITQ
2025-12-19 21:04:12 +03:00
parent d7320f2198
commit 5c89ca5f09
21 changed files with 288 additions and 107 deletions
+19 -6
View File
@@ -3,15 +3,19 @@ package grpc
import (
"context"
pb "datarush/pkg/api/user"
"google.golang.org/protobuf/types/known/emptypb"
pb "datarush/pkg/api/user"
)
type UserService interface {
GetProfile(ctx context.Context, req *pb.GetProfileRequest) (*pb.User, error)
RegisterForCompetition(ctx context.Context, req *pb.RegisterForCompetitionRequest) (*emptypb.Empty, error)
UnregisterFromCompetition(ctx context.Context, req *pb.UnregisterFromCompetitionRequest) (*emptypb.Empty, error)
ListUserCompetitions(ctx context.Context, req *pb.ListUserCompetitionsRequest) (*pb.ListUserCompetitionsResponse, error)
ListUserCompetitions(
ctx context.Context,
req *pb.ListUserCompetitionsRequest,
) (*pb.ListUserCompetitionsResponse, error)
}
type UserHandler struct {
@@ -27,14 +31,23 @@ func (h *UserHandler) GetProfile(ctx context.Context, req *pb.GetProfileRequest)
return h.service.GetProfile(ctx, req)
}
func (h *UserHandler) RegisterForCompetition(ctx context.Context, req *pb.RegisterForCompetitionRequest) (*emptypb.Empty, error) {
func (h *UserHandler) RegisterForCompetition(
ctx context.Context,
req *pb.RegisterForCompetitionRequest,
) (*emptypb.Empty, error) {
return h.service.RegisterForCompetition(ctx, req)
}
func (h *UserHandler) UnregisterFromCompetition(ctx context.Context, req *pb.UnregisterFromCompetitionRequest) (*emptypb.Empty, error) {
func (h *UserHandler) UnregisterFromCompetition(
ctx context.Context,
req *pb.UnregisterFromCompetitionRequest,
) (*emptypb.Empty, error) {
return h.service.UnregisterFromCompetition(ctx, req)
}
func (h *UserHandler) ListUserCompetitions(ctx context.Context, req *pb.ListUserCompetitionsRequest) (*pb.ListUserCompetitionsResponse, error) {
func (h *UserHandler) ListUserCompetitions(
ctx context.Context,
req *pb.ListUserCompetitionsRequest,
) (*pb.ListUserCompetitionsResponse, error) {
return h.service.ListUserCompetitions(ctx, req)
}
}