Package com.bytedesk.service.channel_app
Class ChannelAppRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<ChannelAppEntity,ChannelAppRequest,ChannelAppResponse,ChannelAppExcel>
com.bytedesk.service.channel_app.ChannelAppRestService
@Service
public class ChannelAppRestService
extends BaseRestServiceWithExport<ChannelAppEntity,ChannelAppRequest,ChannelAppResponse,ChannelAppExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChannelAppRepository
private final AuthService
private final org.modelmapper.ModelMapper
private final UidUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel
(ChannelAppEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse
(ChannelAppEntity entity) create
(ChannelAppRequest request) protected org.springframework.data.jpa.domain.Specification<ChannelAppEntity>
createSpecification
(ChannelAppRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(ChannelAppRequest request) void
deleteByUid
(String uid) protected ChannelAppEntity
doSave
(ChannelAppEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<ChannelAppEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<ChannelAppEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid
(String uid) handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, ChannelAppEntity entity) org.springframework.data.domain.Page<ChannelAppResponse>
queryByOrg
(ChannelAppRequest request) 通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法org.springframework.data.domain.Page<ChannelAppEntity>
queryByOrgEntity
(ChannelAppRequest request) 查询实体对象(用于Excel导出) 子类必须实现此方法queryByUid
(ChannelAppRequest request) 通用的queryByUid实现org.springframework.data.domain.Page<ChannelAppResponse>
queryByUser
(ChannelAppRequest request) 通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法update
(ChannelAppRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, recover, save, setUserUidToRequest
-
Field Details
-
appRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
ChannelAppRestService
public ChannelAppRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<ChannelAppEntity> createSpecification(ChannelAppRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<ChannelAppEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<ChannelAppEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
queryByOrgEntity
public org.springframework.data.domain.Page<ChannelAppEntity> queryByOrgEntity(ChannelAppRequest request) Description copied from class:BaseRestServiceWithExport
查询实体对象(用于Excel导出) 子类必须实现此方法 -
queryByOrg
public org.springframework.data.domain.Page<ChannelAppResponse> queryByOrg(ChannelAppRequest request) Description copied from class:BaseRestService
通用的queryByOrg实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByOrg
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
queryByUser
public org.springframework.data.domain.Page<ChannelAppResponse> queryByUser(ChannelAppRequest request) Description copied from class:BaseRestService
通用的queryByUser实现 子类如果有特殊逻辑可以重写此方法- Overrides:
queryByUser
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
queryByUid
Description copied from class:BaseRestService
通用的queryByUid实现- Overrides:
queryByUid
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
findByUid
@Cacheable(value="app", key="#uid", unless="#result==null") public Optional<ChannelAppEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
existsByUid
-
create
- Specified by:
create
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
update
- Specified by:
update
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
handleOptimisticLockingFailureException
public ChannelAppEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ChannelAppEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
delete
- Specified by:
delete
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport
转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcel
in classBaseRestServiceWithExport<ChannelAppEntity,
ChannelAppRequest, ChannelAppResponse, ChannelAppExcel>
-