Package com.bytedesk.social.meta
Class MetaAppRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<MetaAppEntity,MetaAppRequest,MetaAppResponse,MetaAppExcel>
com.bytedesk.social.meta.MetaAppRestService
@Service
public class MetaAppRestService
extends BaseRestServiceWithExport<MetaAppEntity,MetaAppRequest,MetaAppResponse,MetaAppExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MetaAppRepositoryprivate final org.modelmapper.ModelMapperprivate final UidUtilsFields inherited from class com.bytedesk.core.base.BaseRestService
authService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean检查Facebook服务是否可达boolean检查Facebook和Instagram服务是否可达convertToExcel(MetaAppEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(MetaAppEntity entity) create(MetaAppRequest request) protected org.springframework.data.jpa.domain.Specification<MetaAppEntity>createSpecification(MetaAppRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(MetaAppRequest request) voiddeleteByUid(String uid) protected MetaAppEntitydoSave(MetaAppEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<MetaAppEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<MetaAppEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) findAll()findByPageId(String pageId) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, MetaAppEntity entity) org.springframework.data.domain.Page<MetaAppResponse>queryByOrg(MetaAppRequest request) 通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法org.springframework.data.domain.Page<MetaAppEntity>queryByOrgEntity(MetaAppRequest request) 查询实体对象(用于Excel导出) 子类必须实现此方法queryByUid(MetaAppRequest request) 通用的queryByUid实现org.springframework.data.domain.Page<MetaAppResponse>queryByUser(MetaAppRequest request) 通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法voidrefreshAccessToken(MetaAppRequest request) update(MetaAppRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, recover, save, setUserUidToRequest
-
Field Details
-
metaAppRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
-
Constructor Details
-
MetaAppRestService
public MetaAppRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<MetaAppEntity> createSpecification(MetaAppRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<MetaAppEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<MetaAppEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
queryByOrgEntity
Description copied from class:BaseRestServiceWithExport查询实体对象(用于Excel导出) 子类必须实现此方法- Overrides:
queryByOrgEntityin classBaseRestServiceWithExport<MetaAppEntity,MetaAppRequest, MetaAppResponse, MetaAppExcel>
-
queryByOrg
Description copied from class:BaseRestService通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByOrgin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
queryByUser
Description copied from class:BaseRestService通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByUserin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
queryByUid
Description copied from class:BaseRestService通用的queryByUid实现- Overrides:
queryByUidin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
findByUid
@Cacheable(value="app", key="#uid", unless="#result==null") public Optional<MetaAppEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
findByPageId
@Cacheable(value="app:pageId", key="#pageId", unless="#result==null") public Optional<MetaAppEntity> findByPageId(String pageId) -
findAll
-
existsByUid
-
create
- Specified by:
createin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
update
- Specified by:
updatein classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
handleOptimisticLockingFailureException
public MetaAppEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, MetaAppEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
delete
- Specified by:
deletein classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
refreshAccessToken
-
checkServiceReachable
public boolean checkServiceReachable()检查Facebook和Instagram服务是否可达- Returns:
-
checkFacebookReachable
private boolean checkFacebookReachable()检查Facebook服务是否可达 -
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<MetaAppEntity,MetaAppRequest, MetaAppResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<MetaAppEntity,MetaAppRequest, MetaAppResponse, MetaAppExcel>
-