Class AgentStatusRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<AgentStatusEntity,AgentStatusRequest,AgentStatusResponse>
com.bytedesk.service.agent_status.AgentStatusRestService
@Service
public class AgentStatusRestService
extends BaseRestService<AgentStatusEntity,AgentStatusRequest,AgentStatusResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AgentStatusRepository
private final org.modelmapper.ModelMapper
private final UidUtils
Fields inherited from class com.bytedesk.core.base.BaseRestService
authService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse
(AgentStatusEntity entity) create
(AgentStatusRequest request) protected org.springframework.data.jpa.domain.Specification<AgentStatusEntity>
createSpecification
(AgentStatusRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(AgentStatusRequest entity) void
deleteByUid
(String uid) protected AgentStatusEntity
doSave
(AgentStatusEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<AgentStatusEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<AgentStatusEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, AgentStatusEntity entity) save
(AgentStatusEntity entity) 保存实体,带重试机制update
(AgentStatusRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, setUserUidToRequest
-
Field Details
-
agentStatusRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
-
Constructor Details
-
AgentStatusRestService
public AgentStatusRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<AgentStatusEntity> createSpecification(AgentStatusRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<AgentStatusEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<AgentStatusEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
findByUid
@Cacheable(value="agentStatus", key="#uid", unless="#result == null") public Optional<AgentStatusEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
create
- Specified by:
create
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
update
- Specified by:
update
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
save
Description copied from class:BaseRestService
保存实体,带重试机制- Overrides:
save
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
delete
- Specified by:
delete
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
handleOptimisticLockingFailureException
public AgentStatusEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AgentStatusEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<AgentStatusEntity,
AgentStatusRequest, AgentStatusResponse>
-