Package com.bytedesk.service.agent
Class AgentRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<AgentEntity,AgentRequest,AgentResponse>
com.bytedesk.service.agent.AgentRestService
@Service
public class AgentRestService
extends BaseRestService<AgentEntity,AgentRequest,AgentResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AgentRepository
private final AuthService
private final BytedeskEventPublisher
private final MemberRestService
private final org.modelmapper.ModelMapper
private final MqttConnectionService
private final ServiceSettingsService
private final ThreadRestService
private final UidUtils
private final UserService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptByAgent
(ThreadRequest threadRequest) convertToResponse
(AgentEntity entity) create
(AgentRequest request) void
createFromMember
(String mobile, String orgUid) protected org.springframework.data.jpa.domain.Specification<AgentEntity>
createSpecification
(AgentRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(AgentRequest request) void
deleteByUid
(String uid) protected AgentEntity
doSave
(AgentEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<AgentEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<AgentEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid
(String uid) existsByUserUidAndOrgUid
(String userUid, String orgUid) findByConnected
(boolean connected) findByEmailAndOrgUid
(String email, String orgUid) findByMobileAndOrgUid
(String mobile, String orgUid) findByUserUid
(String userUid) findByUserUidAndOrgUid
(String userUid, String orgUid) handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, AgentEntity agent) query
(AgentRequest request) syncCurrentThreadCount
(AgentRequest request) update
(AgentRequest request) updateAutoReply
(AgentRequest request) updateAvatar
(AgentRequest request) void
void
updateConnect
(String userUid, boolean connected) 更新坐席在线状态updateStatus
(AgentRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, save, setUserUidToRequest
-
Field Details
-
agentRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
memberRestService
-
userService
-
authService
-
bytedeskEventPublisher
-
serviceSettingsService
-
mqttConnectionService
-
threadRestService
-
-
Constructor Details
-
AgentRestService
public AgentRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<AgentEntity> createSpecification(AgentRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<AgentEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<AgentEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
query
-
create
- Specified by:
create
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
createFromMember
-
update
- Specified by:
update
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
updateAvatar
-
updateStatus
-
updateConnect
public void updateConnect() -
acceptByAgent
-
syncCurrentThreadCount
-
updateAutoReply
-
updateConnect
更新坐席在线状态- Parameters:
userUid
- 用户IDconnected
- 是否在线
-
doSave
@Cacheable(value="agent", key="#entity.uid", unless="#result == null") protected AgentEntity doSave(AgentEntity entity) Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
delete
- Specified by:
delete
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
handleOptimisticLockingFailureException
public AgentEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AgentEntity agent) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
findByUid
@Cacheable(value="agent", key="#uid", unless="#result == null") public Optional<AgentEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<AgentEntity,
AgentRequest, AgentResponse>
-
findByUserUid
@Cacheable(value="agent", key="#userUid", unless="#result == null") public Optional<AgentEntity> findByUserUid(String userUid) -
findByMobileAndOrgUid
@Cacheable(value="agent", key="#mobile", unless="#result == null") public Optional<AgentEntity> findByMobileAndOrgUid(String mobile, String orgUid) -
findByEmailAndOrgUid
@Cacheable(value="agent", key="#email", unless="#result == null") public Optional<AgentEntity> findByEmailAndOrgUid(String email, String orgUid) -
findByUserUidAndOrgUid
@Cacheable(value="agent", key="#userUid", unless="#result == null") public Optional<AgentEntity> findByUserUidAndOrgUid(String userUid, String orgUid) -
existsByUserUidAndOrgUid
-
existsByUid
-
findAllConnected
-
findByConnected
-