Class CommentService
java.lang.Object
es.kukenan.smartfi.microservice.transfer.service.CommentService
Comment service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommentRepositoryComment repository.private ImageRepositoryImage repository. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiones.kukenan.smartfi.microservice.transfer.api.comment.CommentDtocreateComment(es.kukenan.smartfi.microservice.transfer.api.comment.CommentRequestDto commentRequestDto, String userId) Create a comment.voiddeleteComment(String commentId, String userId) Delete a comment.es.kukenan.smartfi.microservice.transfer.api.comment.CommentDtogetComment(String productId, String transferId, String userId) Find comment product, movement, and user IDs.es.kukenan.smartfi.microservice.transfer.api.comment.CommentDtoupdateComment(es.kukenan.smartfi.microservice.transfer.api.comment.CommentRequestDto newComment, String commentId, String userId) Update a comment.
-
Field Details
-
commentRepository
Comment repository. -
imageRepository
Image repository.
-
-
Constructor Details
-
CommentService
public CommentService()
-
-
Method Details
-
createComment
public es.kukenan.smartfi.microservice.transfer.api.comment.CommentDto createComment(es.kukenan.smartfi.microservice.transfer.api.comment.CommentRequestDto commentRequestDto, String userId) Create a comment.- Parameters:
commentRequestDto- request data to create the comment.userId- user identifier.- Returns:
- the created comment.
-
getComment
public es.kukenan.smartfi.microservice.transfer.api.comment.CommentDto getComment(String productId, String transferId, String userId) Find comment product, movement, and user IDs.- Parameters:
productId- product identifier.transferId- transfer identifier.userId- user identifier.- Returns:
- comment.
-
deleteComment
Delete a comment.- Parameters:
commentId- comment ID.userId- user ID.
-
updateComment
public es.kukenan.smartfi.microservice.transfer.api.comment.CommentDto updateComment(es.kukenan.smartfi.microservice.transfer.api.comment.CommentRequestDto newComment, String commentId, String userId) Update a comment.- Parameters:
newComment- request Dto containing new data.commentId- comment identifier.userId- user identifier.- Returns:
- comment.
-