Documentation ¶
Index ¶
- Variables
- func RegisterCommentsServiceServer(s *grpc.Server, srv CommentsServiceServer)
- func UsersGRPCClientFactory(logger logger.Logger, cfg *config.Config, tracer opentracing.Tracer) func(ctx context.Context) (*grpc.ClientConn, users.UserServiceClient, error)
- type Application
- type Comment
- func (*Comment) Descriptor() ([]byte, []int)deprecated
- func (x *Comment) GetCommentID() string
- func (x *Comment) GetCreatedAt() *timestamp.Timestamp
- func (x *Comment) GetHotelID() string
- func (x *Comment) GetMessage() string
- func (x *Comment) GetPhotos() []string
- func (x *Comment) GetRating() float64
- func (x *Comment) GetUpdatedAt() *timestamp.Timestamp
- func (x *Comment) GetUserID() string
- func (*Comment) ProtoMessage()
- func (x *Comment) ProtoReflect() protoreflect.Message
- func (x *Comment) Reset()
- func (x *Comment) String() string
- type CommentDO
- type CommentFull
- func (*CommentFull) Descriptor() ([]byte, []int)deprecated
- func (x *CommentFull) GetCommentID() string
- func (x *CommentFull) GetCreatedAt() *timestamp.Timestamp
- func (x *CommentFull) GetHotelID() string
- func (x *CommentFull) GetMessage() string
- func (x *CommentFull) GetPhotos() []string
- func (x *CommentFull) GetRating() float64
- func (x *CommentFull) GetUpdatedAt() *timestamp.Timestamp
- func (x *CommentFull) GetUser() *users.User
- func (*CommentFull) ProtoMessage()
- func (x *CommentFull) ProtoReflect() protoreflect.Message
- func (x *CommentFull) Reset()
- func (x *CommentFull) String() string
- type CommentsServiceClient
- type CommentsServiceServer
- type CreateCommentRequest
- func (*CreateCommentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateCommentRequest) GetHotelID() string
- func (x *CreateCommentRequest) GetMessage() string
- func (x *CreateCommentRequest) GetPhotos() []string
- func (x *CreateCommentRequest) GetRating() float64
- func (x *CreateCommentRequest) GetUserID() string
- func (*CreateCommentRequest) ProtoMessage()
- func (x *CreateCommentRequest) ProtoReflect() protoreflect.Message
- func (x *CreateCommentRequest) Reset()
- func (x *CreateCommentRequest) String() string
- type CreateCommentResponse
- func (*CreateCommentResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateCommentResponse) GetComment() *Comment
- func (*CreateCommentResponse) ProtoMessage()
- func (x *CreateCommentResponse) ProtoReflect() protoreflect.Message
- func (x *CreateCommentResponse) Reset()
- func (x *CreateCommentResponse) String() string
- type FullCommentsList
- type FullList
- type GRPCServer
- func (c *GRPCServer) CreateComment(ctx context.Context, req *CreateCommentRequest) (*CreateCommentResponse, error)
- func (c *GRPCServer) GetByHotelID(ctx context.Context, req *GetCommentsByHotelRequest) (*GetCommentsByHotelResponse, error)
- func (c *GRPCServer) GetCommByID(ctx context.Context, req *GetCommentByIDRequest) (*GetCommentByIDResponse, error)
- func (c *GRPCServer) UpdateComment(ctx context.Context, req *UpdateCommentRequest) (*UpdateCommentResponse, error)
- type GetCommentByIDRequest
- func (*GetCommentByIDRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommentByIDRequest) GetCommentID() string
- func (*GetCommentByIDRequest) ProtoMessage()
- func (x *GetCommentByIDRequest) ProtoReflect() protoreflect.Message
- func (x *GetCommentByIDRequest) Reset()
- func (x *GetCommentByIDRequest) String() string
- type GetCommentByIDResponse
- func (*GetCommentByIDResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommentByIDResponse) GetComment() *Comment
- func (*GetCommentByIDResponse) ProtoMessage()
- func (x *GetCommentByIDResponse) ProtoReflect() protoreflect.Message
- func (x *GetCommentByIDResponse) Reset()
- func (x *GetCommentByIDResponse) String() string
- type GetCommentsByHotelRequest
- func (*GetCommentsByHotelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommentsByHotelRequest) GetHotelID() string
- func (x *GetCommentsByHotelRequest) GetPage() int64
- func (x *GetCommentsByHotelRequest) GetSize() int64
- func (*GetCommentsByHotelRequest) ProtoMessage()
- func (x *GetCommentsByHotelRequest) ProtoReflect() protoreflect.Message
- func (x *GetCommentsByHotelRequest) Reset()
- func (x *GetCommentsByHotelRequest) String() string
- type GetCommentsByHotelResponse
- func (*GetCommentsByHotelResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCommentsByHotelResponse) GetComments() []*CommentFull
- func (x *GetCommentsByHotelResponse) GetHasMore() bool
- func (x *GetCommentsByHotelResponse) GetPage() int64
- func (x *GetCommentsByHotelResponse) GetSize() int64
- func (x *GetCommentsByHotelResponse) GetTotalCount() int64
- func (x *GetCommentsByHotelResponse) GetTotalPages() int64
- func (*GetCommentsByHotelResponse) ProtoMessage()
- func (x *GetCommentsByHotelResponse) ProtoReflect() protoreflect.Message
- func (x *GetCommentsByHotelResponse) Reset()
- func (x *GetCommentsByHotelResponse) String() string
- type List
- type Repository
- type RepositoryImpl
- func (c *RepositoryImpl) Create(ctx context.Context, comment *CommentDO) (*CommentDO, error)
- func (c *RepositoryImpl) GetByHotelID(ctx context.Context, hotelID uuid.UUID, query *pagination.Pagination) (*List, error)
- func (c *RepositoryImpl) GetByID(ctx context.Context, commentID uuid.UUID) (*CommentDO, error)
- func (c *RepositoryImpl) Update(ctx context.Context, comment *CommentDO) (*CommentDO, error)
- type Service
- type ServiceImpl
- func (s *ServiceImpl) Create(ctx context.Context, comment *CommentDO) (*CommentDO, error)
- func (s *ServiceImpl) GetByHotelID(ctx context.Context, hotelID uuid.UUID, query *pagination.Pagination) (*FullList, error)
- func (s *ServiceImpl) GetByID(ctx context.Context, commentID uuid.UUID) (*CommentDO, error)
- func (s *ServiceImpl) Update(ctx context.Context, comment *CommentDO) (*CommentDO, error)
- type UnimplementedCommentsServiceServer
- func (*UnimplementedCommentsServiceServer) CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error)
- func (*UnimplementedCommentsServiceServer) GetByHotelID(context.Context, *GetCommentsByHotelRequest) (*GetCommentsByHotelResponse, error)
- func (*UnimplementedCommentsServiceServer) GetCommByID(context.Context, *GetCommentByIDRequest) (*GetCommentByIDResponse, error)
- func (*UnimplementedCommentsServiceServer) UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error)
- type UpdateCommentRequest
- func (*UpdateCommentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateCommentRequest) GetCommentID() string
- func (x *UpdateCommentRequest) GetMessage() string
- func (x *UpdateCommentRequest) GetPhotos() []string
- func (x *UpdateCommentRequest) GetRating() float64
- func (*UpdateCommentRequest) ProtoMessage()
- func (x *UpdateCommentRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateCommentRequest) Reset()
- func (x *UpdateCommentRequest) String() string
- type UpdateCommentResponse
- func (*UpdateCommentResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateCommentResponse) GetComment() *Comment
- func (*UpdateCommentResponse) ProtoMessage()
- func (x *UpdateCommentResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateCommentResponse) Reset()
- func (x *UpdateCommentResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var File_app_comments_comments_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCommentsServiceServer ¶
func RegisterCommentsServiceServer(s *grpc.Server, srv CommentsServiceServer)
func UsersGRPCClientFactory ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func (*Application) Run ¶
func (a *Application) Run() error
type Comment ¶
type Comment struct { CreatedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` CommentID string `protobuf:"bytes,1,opt,name=CommentID,proto3" json:"CommentID,omitempty"` HotelID string `protobuf:"bytes,2,opt,name=HotelID,proto3" json:"HotelID,omitempty"` UserID string `protobuf:"bytes,3,opt,name=UserID,proto3" json:"UserID,omitempty"` Message string `protobuf:"bytes,4,opt,name=Message,proto3" json:"Message,omitempty"` Photos []string `protobuf:"bytes,5,rep,name=Photos,proto3" json:"Photos,omitempty"` Rating float64 `protobuf:"fixed64,6,opt,name=Rating,proto3" json:"Rating,omitempty"` // contains filtered or unexported fields }
func (*Comment) Descriptor
deprecated
func (*Comment) GetCommentID ¶
func (*Comment) GetCreatedAt ¶
func (*Comment) GetHotelID ¶
func (*Comment) GetMessage ¶
func (*Comment) GetUpdatedAt ¶
func (*Comment) ProtoMessage ¶
func (*Comment) ProtoMessage()
func (*Comment) ProtoReflect ¶
func (x *Comment) ProtoReflect() protoreflect.Message
type CommentDO ¶
type CommentDO struct { CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` Message string `json:"message" validate:"required,min=5,max=500"` Photos []string `json:"photos,omitempty"` Rating float64 `json:"rating" validate:"required,min=0,max=10"` CommentID uuid.UUID `json:"comment_id"` HotelID uuid.UUID `json:"hotel_id"` UserID uuid.UUID `json:"user_id"` }
type CommentFull ¶
type CommentFull struct { CreatedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` User *users.User `protobuf:"bytes,3,opt,name=User,proto3" json:"User,omitempty"` CommentID string `protobuf:"bytes,1,opt,name=CommentID,proto3" json:"CommentID,omitempty"` HotelID string `protobuf:"bytes,2,opt,name=HotelID,proto3" json:"HotelID,omitempty"` Message string `protobuf:"bytes,4,opt,name=Message,proto3" json:"Message,omitempty"` Photos []string `protobuf:"bytes,5,rep,name=Photos,proto3" json:"Photos,omitempty"` Rating float64 `protobuf:"fixed64,6,opt,name=Rating,proto3" json:"Rating,omitempty"` // contains filtered or unexported fields }
func (*CommentFull) Descriptor
deprecated
func (*CommentFull) Descriptor() ([]byte, []int)
Deprecated: Use CommentFull.ProtoReflect.Descriptor instead.
func (*CommentFull) GetCommentID ¶
func (x *CommentFull) GetCommentID() string
func (*CommentFull) GetCreatedAt ¶
func (x *CommentFull) GetCreatedAt() *timestamp.Timestamp
func (*CommentFull) GetHotelID ¶
func (x *CommentFull) GetHotelID() string
func (*CommentFull) GetMessage ¶
func (x *CommentFull) GetMessage() string
func (*CommentFull) GetPhotos ¶
func (x *CommentFull) GetPhotos() []string
func (*CommentFull) GetRating ¶
func (x *CommentFull) GetRating() float64
func (*CommentFull) GetUpdatedAt ¶
func (x *CommentFull) GetUpdatedAt() *timestamp.Timestamp
func (*CommentFull) GetUser ¶
func (x *CommentFull) GetUser() *users.User
func (*CommentFull) ProtoMessage ¶
func (*CommentFull) ProtoMessage()
func (*CommentFull) ProtoReflect ¶
func (x *CommentFull) ProtoReflect() protoreflect.Message
func (*CommentFull) Reset ¶
func (x *CommentFull) Reset()
func (*CommentFull) String ¶
func (x *CommentFull) String() string
type CommentsServiceClient ¶
type CommentsServiceClient interface { CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*CreateCommentResponse, error) GetCommByID(ctx context.Context, in *GetCommentByIDRequest, opts ...grpc.CallOption) (*GetCommentByIDResponse, error) UpdateComment(ctx context.Context, in *UpdateCommentRequest, opts ...grpc.CallOption) (*UpdateCommentResponse, error) GetByHotelID(ctx context.Context, in *GetCommentsByHotelRequest, opts ...grpc.CallOption) (*GetCommentsByHotelResponse, error) }
CommentsServiceClient is the client API for CommentsService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCommentsServiceClient ¶
func NewCommentsServiceClient(cc grpc.ClientConnInterface) CommentsServiceClient
type CommentsServiceServer ¶
type CommentsServiceServer interface { CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error) GetCommByID(context.Context, *GetCommentByIDRequest) (*GetCommentByIDResponse, error) UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error) GetByHotelID(context.Context, *GetCommentsByHotelRequest) (*GetCommentsByHotelResponse, error) }
CommentsServiceServer is the server API for CommentsService service.
type CreateCommentRequest ¶
type CreateCommentRequest struct { HotelID string `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"` UserID string `protobuf:"bytes,2,opt,name=UserID,proto3" json:"UserID,omitempty"` Message string `protobuf:"bytes,3,opt,name=Message,proto3" json:"Message,omitempty"` Photos []string `protobuf:"bytes,4,rep,name=Photos,proto3" json:"Photos,omitempty"` Rating float64 `protobuf:"fixed64,5,opt,name=Rating,proto3" json:"Rating,omitempty"` // contains filtered or unexported fields }
func (*CreateCommentRequest) Descriptor
deprecated
func (*CreateCommentRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateCommentRequest.ProtoReflect.Descriptor instead.
func (*CreateCommentRequest) GetHotelID ¶
func (x *CreateCommentRequest) GetHotelID() string
func (*CreateCommentRequest) GetMessage ¶
func (x *CreateCommentRequest) GetMessage() string
func (*CreateCommentRequest) GetPhotos ¶
func (x *CreateCommentRequest) GetPhotos() []string
func (*CreateCommentRequest) GetRating ¶
func (x *CreateCommentRequest) GetRating() float64
func (*CreateCommentRequest) GetUserID ¶
func (x *CreateCommentRequest) GetUserID() string
func (*CreateCommentRequest) ProtoMessage ¶
func (*CreateCommentRequest) ProtoMessage()
func (*CreateCommentRequest) ProtoReflect ¶
func (x *CreateCommentRequest) ProtoReflect() protoreflect.Message
func (*CreateCommentRequest) Reset ¶
func (x *CreateCommentRequest) Reset()
func (*CreateCommentRequest) String ¶
func (x *CreateCommentRequest) String() string
type CreateCommentResponse ¶
type CreateCommentResponse struct { Comment *Comment `protobuf:"bytes,1,opt,name=Comment,proto3" json:"Comment,omitempty"` // contains filtered or unexported fields }
func (*CreateCommentResponse) Descriptor
deprecated
func (*CreateCommentResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateCommentResponse.ProtoReflect.Descriptor instead.
func (*CreateCommentResponse) GetComment ¶
func (x *CreateCommentResponse) GetComment() *Comment
func (*CreateCommentResponse) ProtoMessage ¶
func (*CreateCommentResponse) ProtoMessage()
func (*CreateCommentResponse) ProtoReflect ¶
func (x *CreateCommentResponse) ProtoReflect() protoreflect.Message
func (*CreateCommentResponse) Reset ¶
func (x *CreateCommentResponse) Reset()
func (*CreateCommentResponse) String ¶
func (x *CreateCommentResponse) String() string
type FullCommentsList ¶
type FullCommentsList struct { UsersList []users.UserResponse CommentsList List }
type FullList ¶
type FullList struct { Comments []*CommentFull `json:"comments"` TotalCount int `json:"totalCount"` TotalPages int `json:"totalPages"` Page int `json:"page"` Size int `json:"size"` HasMore bool `json:"hasMore"` }
All Comments response with pagination
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
func (*GRPCServer) CreateComment ¶
func (c *GRPCServer) CreateComment(ctx context.Context, req *CreateCommentRequest) (*CreateCommentResponse, error)
func (*GRPCServer) GetByHotelID ¶
func (c *GRPCServer) GetByHotelID(ctx context.Context, req *GetCommentsByHotelRequest) (*GetCommentsByHotelResponse, error)
func (*GRPCServer) GetCommByID ¶
func (c *GRPCServer) GetCommByID(ctx context.Context, req *GetCommentByIDRequest) (*GetCommentByIDResponse, error)
func (*GRPCServer) UpdateComment ¶
func (c *GRPCServer) UpdateComment(ctx context.Context, req *UpdateCommentRequest) (*UpdateCommentResponse, error)
type GetCommentByIDRequest ¶
type GetCommentByIDRequest struct { CommentID string `protobuf:"bytes,1,opt,name=CommentID,proto3" json:"CommentID,omitempty"` // contains filtered or unexported fields }
func (*GetCommentByIDRequest) Descriptor
deprecated
func (*GetCommentByIDRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentByIDRequest.ProtoReflect.Descriptor instead.
func (*GetCommentByIDRequest) GetCommentID ¶
func (x *GetCommentByIDRequest) GetCommentID() string
func (*GetCommentByIDRequest) ProtoMessage ¶
func (*GetCommentByIDRequest) ProtoMessage()
func (*GetCommentByIDRequest) ProtoReflect ¶
func (x *GetCommentByIDRequest) ProtoReflect() protoreflect.Message
func (*GetCommentByIDRequest) Reset ¶
func (x *GetCommentByIDRequest) Reset()
func (*GetCommentByIDRequest) String ¶
func (x *GetCommentByIDRequest) String() string
type GetCommentByIDResponse ¶
type GetCommentByIDResponse struct { Comment *Comment `protobuf:"bytes,1,opt,name=Comment,proto3" json:"Comment,omitempty"` // contains filtered or unexported fields }
func (*GetCommentByIDResponse) Descriptor
deprecated
func (*GetCommentByIDResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentByIDResponse.ProtoReflect.Descriptor instead.
func (*GetCommentByIDResponse) GetComment ¶
func (x *GetCommentByIDResponse) GetComment() *Comment
func (*GetCommentByIDResponse) ProtoMessage ¶
func (*GetCommentByIDResponse) ProtoMessage()
func (*GetCommentByIDResponse) ProtoReflect ¶
func (x *GetCommentByIDResponse) ProtoReflect() protoreflect.Message
func (*GetCommentByIDResponse) Reset ¶
func (x *GetCommentByIDResponse) Reset()
func (*GetCommentByIDResponse) String ¶
func (x *GetCommentByIDResponse) String() string
type GetCommentsByHotelRequest ¶
type GetCommentsByHotelRequest struct { HotelID string `protobuf:"bytes,1,opt,name=HotelID,proto3" json:"HotelID,omitempty"` Page int64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` // contains filtered or unexported fields }
func (*GetCommentsByHotelRequest) Descriptor
deprecated
func (*GetCommentsByHotelRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentsByHotelRequest.ProtoReflect.Descriptor instead.
func (*GetCommentsByHotelRequest) GetHotelID ¶
func (x *GetCommentsByHotelRequest) GetHotelID() string
func (*GetCommentsByHotelRequest) GetPage ¶
func (x *GetCommentsByHotelRequest) GetPage() int64
func (*GetCommentsByHotelRequest) GetSize ¶
func (x *GetCommentsByHotelRequest) GetSize() int64
func (*GetCommentsByHotelRequest) ProtoMessage ¶
func (*GetCommentsByHotelRequest) ProtoMessage()
func (*GetCommentsByHotelRequest) ProtoReflect ¶
func (x *GetCommentsByHotelRequest) ProtoReflect() protoreflect.Message
func (*GetCommentsByHotelRequest) Reset ¶
func (x *GetCommentsByHotelRequest) Reset()
func (*GetCommentsByHotelRequest) String ¶
func (x *GetCommentsByHotelRequest) String() string
type GetCommentsByHotelResponse ¶
type GetCommentsByHotelResponse struct { Comments []*CommentFull `protobuf:"bytes,6,rep,name=Comments,proto3" json:"Comments,omitempty"` TotalCount int64 `protobuf:"varint,1,opt,name=TotalCount,proto3" json:"TotalCount,omitempty"` TotalPages int64 `protobuf:"varint,2,opt,name=TotalPages,proto3" json:"TotalPages,omitempty"` Page int64 `protobuf:"varint,3,opt,name=Page,proto3" json:"Page,omitempty"` Size int64 `protobuf:"varint,4,opt,name=Size,proto3" json:"Size,omitempty"` HasMore bool `protobuf:"varint,5,opt,name=HasMore,proto3" json:"HasMore,omitempty"` // contains filtered or unexported fields }
func (*GetCommentsByHotelResponse) Descriptor
deprecated
func (*GetCommentsByHotelResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCommentsByHotelResponse.ProtoReflect.Descriptor instead.
func (*GetCommentsByHotelResponse) GetComments ¶
func (x *GetCommentsByHotelResponse) GetComments() []*CommentFull
func (*GetCommentsByHotelResponse) GetHasMore ¶
func (x *GetCommentsByHotelResponse) GetHasMore() bool
func (*GetCommentsByHotelResponse) GetPage ¶
func (x *GetCommentsByHotelResponse) GetPage() int64
func (*GetCommentsByHotelResponse) GetSize ¶
func (x *GetCommentsByHotelResponse) GetSize() int64
func (*GetCommentsByHotelResponse) GetTotalCount ¶
func (x *GetCommentsByHotelResponse) GetTotalCount() int64
func (*GetCommentsByHotelResponse) GetTotalPages ¶
func (x *GetCommentsByHotelResponse) GetTotalPages() int64
func (*GetCommentsByHotelResponse) ProtoMessage ¶
func (*GetCommentsByHotelResponse) ProtoMessage()
func (*GetCommentsByHotelResponse) ProtoReflect ¶
func (x *GetCommentsByHotelResponse) ProtoReflect() protoreflect.Message
func (*GetCommentsByHotelResponse) Reset ¶
func (x *GetCommentsByHotelResponse) Reset()
func (*GetCommentsByHotelResponse) String ¶
func (x *GetCommentsByHotelResponse) String() string
type List ¶
type List struct { Comments []*CommentDO `json:"comments"` TotalCount int `json:"totalCount"` TotalPages int `json:"totalPages"` Page int `json:"page"` Size int `json:"size"` HasMore bool `json:"hasMore"` }
All Comments response with pagination
func (*List) ToHotelByIDProto ¶
func (h *List) ToHotelByIDProto(userz []*users.User) []*CommentFull
type Repository ¶
type Repository interface { Create(ctx context.Context, comment *CommentDO) (*CommentDO, error) GetByID(ctx context.Context, commentID uuid.UUID) (*CommentDO, error) Update(ctx context.Context, comment *CommentDO) (*CommentDO, error) GetByHotelID(ctx context.Context, hotelID uuid.UUID, query *pagination.Pagination) (*List, error) }
type RepositoryImpl ¶
type RepositoryImpl struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *pgxpool.Pool) RepositoryImpl
func (*RepositoryImpl) GetByHotelID ¶
func (c *RepositoryImpl) GetByHotelID(ctx context.Context, hotelID uuid.UUID, query *pagination.Pagination) (*List, error)
type Service ¶
type Service interface { Create(ctx context.Context, comment *CommentDO) (*CommentDO, error) GetByID(ctx context.Context, commentID uuid.UUID) (*CommentDO, error) Update(ctx context.Context, comment *CommentDO) (*CommentDO, error) GetByHotelID(ctx context.Context, hotelID uuid.UUID, query *pagination.Pagination) (*FullList, error) }
type ServiceImpl ¶
type ServiceImpl struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( repository Repository, logger logger.Logger, grpcClientFactory func(ctx context.Context) (*grpc.ClientConn, users.UserServiceClient, error), ) ServiceImpl
func (*ServiceImpl) GetByHotelID ¶
func (s *ServiceImpl) GetByHotelID(ctx context.Context, hotelID uuid.UUID, query *pagination.Pagination) (*FullList, error)
type UnimplementedCommentsServiceServer ¶
type UnimplementedCommentsServiceServer struct { }
UnimplementedCommentsServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCommentsServiceServer) CreateComment ¶
func (*UnimplementedCommentsServiceServer) CreateComment(context.Context, *CreateCommentRequest) (*CreateCommentResponse, error)
func (*UnimplementedCommentsServiceServer) GetByHotelID ¶
func (*UnimplementedCommentsServiceServer) GetByHotelID(context.Context, *GetCommentsByHotelRequest) (*GetCommentsByHotelResponse, error)
func (*UnimplementedCommentsServiceServer) GetCommByID ¶
func (*UnimplementedCommentsServiceServer) GetCommByID(context.Context, *GetCommentByIDRequest) (*GetCommentByIDResponse, error)
func (*UnimplementedCommentsServiceServer) UpdateComment ¶
func (*UnimplementedCommentsServiceServer) UpdateComment(context.Context, *UpdateCommentRequest) (*UpdateCommentResponse, error)
type UpdateCommentRequest ¶
type UpdateCommentRequest struct { CommentID string `protobuf:"bytes,1,opt,name=CommentID,proto3" json:"CommentID,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` Photos []string `protobuf:"bytes,3,rep,name=Photos,proto3" json:"Photos,omitempty"` Rating float64 `protobuf:"fixed64,4,opt,name=Rating,proto3" json:"Rating,omitempty"` // contains filtered or unexported fields }
func (*UpdateCommentRequest) Descriptor
deprecated
func (*UpdateCommentRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateCommentRequest.ProtoReflect.Descriptor instead.
func (*UpdateCommentRequest) GetCommentID ¶
func (x *UpdateCommentRequest) GetCommentID() string
func (*UpdateCommentRequest) GetMessage ¶
func (x *UpdateCommentRequest) GetMessage() string
func (*UpdateCommentRequest) GetPhotos ¶
func (x *UpdateCommentRequest) GetPhotos() []string
func (*UpdateCommentRequest) GetRating ¶
func (x *UpdateCommentRequest) GetRating() float64
func (*UpdateCommentRequest) ProtoMessage ¶
func (*UpdateCommentRequest) ProtoMessage()
func (*UpdateCommentRequest) ProtoReflect ¶
func (x *UpdateCommentRequest) ProtoReflect() protoreflect.Message
func (*UpdateCommentRequest) Reset ¶
func (x *UpdateCommentRequest) Reset()
func (*UpdateCommentRequest) String ¶
func (x *UpdateCommentRequest) String() string
type UpdateCommentResponse ¶
type UpdateCommentResponse struct { Comment *Comment `protobuf:"bytes,1,opt,name=Comment,proto3" json:"Comment,omitempty"` // contains filtered or unexported fields }
func (*UpdateCommentResponse) Descriptor
deprecated
func (*UpdateCommentResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateCommentResponse.ProtoReflect.Descriptor instead.
func (*UpdateCommentResponse) GetComment ¶
func (x *UpdateCommentResponse) GetComment() *Comment
func (*UpdateCommentResponse) ProtoMessage ¶
func (*UpdateCommentResponse) ProtoMessage()
func (*UpdateCommentResponse) ProtoReflect ¶
func (x *UpdateCommentResponse) ProtoReflect() protoreflect.Message
func (*UpdateCommentResponse) Reset ¶
func (x *UpdateCommentResponse) Reset()
func (*UpdateCommentResponse) String ¶
func (x *UpdateCommentResponse) String() string