Package com.bytedesk.wechat.mp.black
Class WeChatMpBlackRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<WeChatMpBlackEntity,WeChatMpBlackRequest,WeChatMpBlackResponse>
com.bytedesk.wechat.mp.black.WeChatMpBlackRestService
@Service
public class WeChatMpBlackRestService
extends BaseRestService<WeChatMpBlackEntity,WeChatMpBlackRequest,WeChatMpBlackResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AuthService
private final org.modelmapper.ModelMapper
private final UidUtils
private final WeChatMpBlackRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse
(WeChatMpBlackEntity entity) create
(WeChatMpBlackRequest request) protected org.springframework.data.jpa.domain.Specification<WeChatMpBlackEntity>
createSpecification
(WeChatMpBlackRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(WeChatMpBlackRequest entity) void
deleteByUid
(String uid) protected WeChatMpBlackEntity
doSave
(WeChatMpBlackEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<WeChatMpBlackEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<WeChatMpBlackEntity> specification, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, WeChatMpBlackEntity entity) org.springframework.data.domain.Page<WeChatMpBlackResponse>
queryByOrg
(WeChatMpBlackRequest request) 通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法queryByUid
(WeChatMpBlackRequest request) 通用的queryByUid实现org.springframework.data.domain.Page<WeChatMpBlackResponse>
queryByUser
(WeChatMpBlackRequest request) 通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法save
(WeChatMpBlackEntity entity) 保存实体,带重试机制update
(WeChatMpBlackRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, recover, setUserUidToRequest
-
Field Details
-
weChatMpBlackRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
WeChatMpBlackRestService
public WeChatMpBlackRestService()
-
-
Method Details
-
queryByOrg
public org.springframework.data.domain.Page<WeChatMpBlackResponse> queryByOrg(WeChatMpBlackRequest request) Description copied from class:BaseRestService
通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByOrg
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
queryByUser
public org.springframework.data.domain.Page<WeChatMpBlackResponse> queryByUser(WeChatMpBlackRequest request) Description copied from class:BaseRestService
通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByUser
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
findByUid
@Cacheable(value="wechatmpBlack", key="#uid") public Optional<WeChatMpBlackEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
create
- Specified by:
create
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
update
- Specified by:
update
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
save
@CachePut(value="wechatmpBlack", key="#entity.uid") public WeChatMpBlackEntity save(WeChatMpBlackEntity entity) Description copied from class:BaseRestService
保存实体,带重试机制- Overrides:
save
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
delete
@CacheEvict(value="wechatmpBlack", key="#entity.uid") public void delete(WeChatMpBlackRequest entity) - Specified by:
delete
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
handleOptimisticLockingFailureException
public WeChatMpBlackEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, WeChatMpBlackEntity entity) -
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
queryByUid
Description copied from class:BaseRestService
通用的queryByUid实现- Overrides:
queryByUid
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<WeChatMpBlackEntity> createSpecification(WeChatMpBlackRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<WeChatMpBlackEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<WeChatMpBlackEntity> specification, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
in classBaseRestService<WeChatMpBlackEntity,
WeChatMpBlackRequest, WeChatMpBlackResponse>
-