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) protected org.springframework.data.jpa.domain.Specification<CommentEntity>
createSpecification
(CommentRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(CommentRequest request) void
deleteByUid
(String uid) protected CommentEntity
doSave
(CommentEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<CommentEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<CommentEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, CommentEntity entity) save
(CommentEntity entity) 保存实体,带重试机制update
(CommentRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, setUserUidToRequest
-
Field Details
-
commentRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
CommentRestService
public CommentRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<CommentEntity> createSpecification(CommentRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<CommentEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<CommentEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
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
Description copied from class:BaseRestService
保存实体,带重试机制- Overrides:
save
in classBaseRestService<CommentEntity,
CommentRequest, CommentResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
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 CommentEntity 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>
-