From 1b78e5c852ba588dd241fb325b453bfc43676d31 Mon Sep 17 00:00:00 2001 From: Amir Date: Tue, 3 Sep 2024 22:57:37 +0330 Subject: [PATCH] fmt --- internal/service/user/user_errors.go | 8 ++++---- internal/service/user/user_service.go | 2 +- internal/service/user/user_vali.go | 3 +-- protobuf/user/v1/user.proto | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/internal/service/user/user_errors.go b/internal/service/user/user_errors.go index cca414f..abe23f4 100644 --- a/internal/service/user/user_errors.go +++ b/internal/service/user/user_errors.go @@ -3,9 +3,9 @@ package user import "errors" var ( - ErrNotFound = errors.New("user not found") - ErrUpdateUser = errors.New("failed to update user") - ErrDeleteUser = errors.New("failed to delete user") - ErrPlacePicture = errors.New("failed to place picture") + ErrNotFound = errors.New("user not found") + ErrUpdateUser = errors.New("failed to update user") + ErrDeleteUser = errors.New("failed to delete user") + ErrPlacePicture = errors.New("failed to place picture") ErrUpdatePicture = errors.New("failed to update picture") ) diff --git a/internal/service/user/user_service.go b/internal/service/user/user_service.go index b1945f2..00308a2 100644 --- a/internal/service/user/user_service.go +++ b/internal/service/user/user_service.go @@ -71,7 +71,7 @@ func (s *UserManager) UpdateProfilePicture(ctx context.Context, userID model.Use if len(validationErrors) > 0 { return &vali.Varror{ValidationErrors: validationErrors} } - + err := s.fileManager.SetFile(filename, filepath.Join(config.ProjectRootPath, uploadDir, userID)) if err != nil { return &vali.Varror{Error: ErrPlacePicture} diff --git a/internal/service/user/user_vali.go b/internal/service/user/user_vali.go index fe3f10b..877e6c8 100644 --- a/internal/service/user/user_vali.go +++ b/internal/service/user/user_vali.go @@ -7,7 +7,6 @@ type UpdateProfileValidation struct { } type UpdateProfilePictureValidation struct { - UserID string `validate:"required"` + UserID string `validate:"required"` FileName string `validate:"required"` } - diff --git a/protobuf/user/v1/user.proto b/protobuf/user/v1/user.proto index f8dba0f..d88c569 100644 --- a/protobuf/user/v1/user.proto +++ b/protobuf/user/v1/user.proto @@ -4,11 +4,11 @@ package protobuf.user.v1; option go_package = "protobuf/user/v1"; service UserService { - rpc UploadProfile(stream UploadProfileRequest)returns(UploadProfileResponse){} + rpc UploadProfile(stream UploadProfileRequest) returns (UploadProfileResponse) {} } -message UploadProfileRequest{ - bytes bytes = 1; +message UploadProfileRequest { + bytes bytes = 1; } -message UploadProfileResponse{} \ No newline at end of file +message UploadProfileResponse {}