Package com.bytedesk.kbase.comment
Class CommentRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<CommentEntity,CommentRequest,CommentResponse>
com.bytedesk.kbase.comment.CommentRestService
@Service
public class CommentRestService
extends BaseRestService<CommentEntity,CommentRequest,CommentResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AuthService
private final CommentRepository
private final org.modelmapper.ModelMapper
private final UidUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse
(CommentEntity entity) create
(CommentRequest request) void
delete
(CommentRequest request) void
deleteByUid
(String uid) void
handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, CommentEntity entity) org.springframework.data.domain.Page<CommentResponse>
queryByOrg
(CommentRequest request) org.springframework.data.domain.Page<CommentResponse>
queryByUser
(CommentRequest request) save
(CommentEntity entity) update
(CommentRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
getUidFromRequest, queryByUid
-
Field Details
-
commentRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
CommentRestService
public CommentRestService()
-
-
Method Details
-
queryByOrg
- Specified by:
queryByOrg
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
queryByUser
- Specified by:
queryByUser
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
findByUid
@Cacheable(value="comment", key="#uid", unless="#result==null") public Optional<CommentEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
create
- Specified by:
create
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
update
- Specified by:
update
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
save
- Specified by:
save
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
delete
- Specified by:
delete
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
handleOptimisticLockingFailureException
public void handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, CommentEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-