Package com.bytedesk.social.zalo
Class ZaloRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<ZaloEntity,ZaloRequest,ZaloResponse,ZaloExcel>
com.bytedesk.social.zalo.ZaloRestService
@Service
public class ZaloRestService
extends BaseRestServiceWithExport<ZaloEntity,ZaloRequest,ZaloResponse,ZaloExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.modelmapper.ModelMapperprivate final ZaloRepositoryprivate final UidUtilsFields inherited from class com.bytedesk.core.base.BaseRestService
authService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(ZaloEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(ZaloEntity entity) create(ZaloRequest request) protected org.springframework.data.jpa.domain.Specification<ZaloEntity>createSpecification(ZaloRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(ZaloRequest request) voiddeleteByUid(String uid) protected ZaloEntitydoSave(ZaloEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<ZaloEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<ZaloEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) findAll()handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ZaloEntity entity) org.springframework.data.domain.Page<ZaloResponse>queryByOrg(ZaloRequest request) 通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法org.springframework.data.domain.Page<ZaloEntity>queryByOrgEntity(ZaloRequest request) 查询实体对象(用于Excel导出) 子类必须实现此方法queryByUid(ZaloRequest request) 通用的queryByUid实现org.springframework.data.domain.Page<ZaloResponse>queryByUser(ZaloRequest request) 通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法voidrefreshAccessToken(ZaloRequest request) private voidrefreshKefuAccessToken(ZaloRequest request) private voidrefreshMiniAccessToken(ZaloRequest request) private voidrefreshMpAccessToken(ZaloRequest request) private voidrefreshWorkAccessToken(ZaloEntity zaloEntity) update(ZaloRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, recover, save, setUserUidToRequest
-
Field Details
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
Constructor Details
-
ZaloRestService
public ZaloRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<ZaloEntity> createSpecification(ZaloRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<ZaloEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<ZaloEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
queryByOrgEntity
Description copied from class:BaseRestServiceWithExport查询实体对象(用于Excel导出) 子类必须实现此方法- Overrides:
queryByOrgEntityin classBaseRestServiceWithExport<ZaloEntity,ZaloRequest, ZaloResponse, ZaloExcel>
-
queryByOrg
Description copied from class:BaseRestService通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByOrgin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
queryByUser
Description copied from class:BaseRestService通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByUserin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
queryByUid
Description copied from class:BaseRestService通用的queryByUid实现- Overrides:
queryByUidin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
findByUid
@Cacheable(value="app", key="#uid", unless="#result==null") public Optional<ZaloEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
findAll
-
existsByUid
-
create
- Specified by:
createin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
update
- Specified by:
updatein classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
handleOptimisticLockingFailureException
public ZaloEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ZaloEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
delete
- Specified by:
deletein classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
refreshAccessToken
-
refreshWorkAccessToken
-
refreshMpAccessToken
-
refreshMiniAccessToken
-
refreshKefuAccessToken
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<ZaloEntity,ZaloRequest, ZaloResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<ZaloEntity,ZaloRequest, ZaloResponse, ZaloExcel>
-
socialAppRepository