Package com.bytedesk.core.action
Class ActionRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<ActionEntity,ActionRequest,ActionResponse,ActionExcel>
com.bytedesk.core.action.ActionRestService
@Service
public class ActionRestService
extends BaseRestServiceWithExport<ActionEntity,ActionRequest,ActionResponse,ActionExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ActionRepositoryprivate final AuthServiceprivate final org.modelmapper.ModelMapperprivate final UidUtils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(ActionEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(ActionEntity action) create(ActionRequest actionRequest) protected org.springframework.data.jpa.domain.Specification<ActionEntity>createSpecification(ActionRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(ActionRequest entity) voiddeleteByUid(String uid) protected ActionEntitydoSave(ActionEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<ActionEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<ActionEntity> specification, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ActionEntity entity) update(ActionRequest 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
-
actionRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
ActionRestService
public ActionRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<ActionEntity> createSpecification(ActionRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<ActionEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<ActionEntity> specification, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
findByUid
@Cacheable(cacheNames="action", key="#request.uid", unless="#result == null") public Optional<ActionEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
create
- Specified by:
createin classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
update
- Specified by:
updatein classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
delete
- Specified by:
deletein classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
handleOptimisticLockingFailureException
public ActionEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ActionEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<ActionEntity,ActionRequest, ActionResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<ActionEntity,ActionRequest, ActionResponse, ActionExcel>
-