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的通用实现voiddelete(RobotThreadRequest request) voiddeleteByUid(String uid) protected RobotThreadEntitydoSave(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:
createSpecificationin 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:
executePageQueryin classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
findByUid
@Cacheable(value="robot_thread", key="#uid", unless="#result == null") public Optional<RobotThreadEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
existsByUid
-
findFirstByTopic
@Cacheable(value="robot_thread", key="#topic", unless="#result == null") public Optional<RobotThreadEntity> findFirstByTopic(String topic) -
create
- Specified by:
createin classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
update
- Specified by:
updatein classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
delete
- Specified by:
deletein classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
handleOptimisticLockingFailureException
public RobotThreadEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, RobotThreadEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<RobotThreadEntity,RobotThreadRequest, RobotThreadResponse>
-