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