Package com.bytedesk.ai.robot_thread
Class RobotThreadRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<RobotThreadEntity,RobotThreadRequest,RobotThreadResponse>
com.bytedesk.ai.robot_thread.RobotThreadRestService
@Service
public class RobotThreadRestService
extends BaseRestService<RobotThreadEntity,RobotThreadRequest,RobotThreadResponse>
-
Field Summary
FieldsFields inherited from class com.bytedesk.core.base.BaseRestService
authService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse
(RobotThreadEntity entity) create
(RobotThreadRequest request) protected org.springframework.data.jpa.domain.Specification<RobotThreadEntity>
createSpecification
(RobotThreadRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现void
delete
(RobotThreadRequest request) void
deleteByUid
(String uid) protected RobotThreadEntity
doSave
(RobotThreadEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<RobotThreadEntity>
executePageQuery
(org.springframework.data.jpa.domain.Specification<RobotThreadEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid
(String uid) findFirstByTopic
(String topic) handleOptimisticLockingFailureException
(org.springframework.orm.ObjectOptimisticLockingFailureException e, RobotThreadEntity entity) update
(RobotThreadRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, save, setUserUidToRequest
-
Field Details
-
threadRepository
-
-
Constructor Details
-
RobotThreadRestService
public RobotThreadRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<RobotThreadEntity> createSpecification(RobotThreadRequest request) Description copied from class:BaseRestService
创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecification
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<RobotThreadEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<RobotThreadEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService
执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQuery
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
findByUid
@Cacheable(value="robot_thread", key="#uid", unless="#result == null") public Optional<RobotThreadEntity> findByUid(String uid) - Specified by:
findByUid
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
existsByUid
-
findFirstByTopic
@Cacheable(value="robot_thread", key="#topic", unless="#result == null") public Optional<RobotThreadEntity> findFirstByTopic(String topic) -
create
- Specified by:
create
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
update
- Specified by:
update
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
delete
- Specified by:
delete
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
handleOptimisticLockingFailureException
public RobotThreadEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, RobotThreadEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<RobotThreadEntity,
RobotThreadRequest, RobotThreadResponse>
-