Package com.bytedesk.wechat.app
Class WeChatAppRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<WeChatAppEntity,WeChatAppRequest,WeChatAppResponse,WeChatAppExcel>
com.bytedesk.wechat.app.WeChatAppRestService
@Service
public class WeChatAppRestService
extends BaseRestServiceWithExport<WeChatAppEntity,WeChatAppRequest,WeChatAppResponse,WeChatAppExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.modelmapper.ModelMapperprivate final UidUtilsprivate final WeChatAppRepositoryprivate final WeChatWorkTokenServiceFields inherited from class com.bytedesk.core.base.BaseRestService
authService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(WeChatAppEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(WeChatAppEntity entity) create(WeChatAppRequest request) protected org.springframework.data.jpa.domain.Specification<WeChatAppEntity>createSpecification(WeChatAppRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(WeChatAppRequest request) voiddeleteByUid(String uid) protected WeChatAppEntitydoSave(WeChatAppEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<WeChatAppEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<WeChatAppEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) findAll()handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, WeChatAppEntity entity) voidrefreshAccessToken(WeChatAppRequest request) private voidrefreshKefuAccessToken(WeChatAppRequest request) private voidrefreshMiniAccessToken(WeChatAppRequest request) private voidrefreshMpAccessToken(WeChatAppRequest request) private voidrefreshWorkAccessToken(WeChatAppEntity weChatAppEntity) update(WeChatAppRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestServiceWithExport
queryByOrgEntityMethods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, save, setUserUidToRequest
-
Field Details
-
wechatAppRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
weChatWorkTokenService
-
-
Constructor Details
-
WeChatAppRestService
public WeChatAppRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<WeChatAppEntity> createSpecification(WeChatAppRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<WeChatAppEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<WeChatAppEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
findByUid
@Cacheable(value="app", key="#uid", unless="#result==null") public Optional<WeChatAppEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
findAll
-
existsByUid
-
create
- Specified by:
createin classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
update
- Specified by:
updatein classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
handleOptimisticLockingFailureException
public WeChatAppEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, WeChatAppEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
delete
- Specified by:
deletein classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
refreshAccessToken
-
refreshWorkAccessToken
-
refreshMpAccessToken
-
refreshMiniAccessToken
-
refreshKefuAccessToken
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<WeChatAppEntity,WeChatAppRequest, WeChatAppResponse, WeChatAppExcel>
-