Package com.bytedesk.kbase.llm_chunk
Class ChunkRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<ChunkEntity,ChunkRequest,ChunkResponse,ChunkExcel>
com.bytedesk.kbase.llm_chunk.ChunkRestService
@Service
public class ChunkRestService
extends BaseRestServiceWithExport<ChunkEntity,ChunkRequest,ChunkResponse,ChunkExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BytedeskEventPublisherprivate final ChunkRepositoryprivate final FileRestServiceprivate final KbaseRestServiceprivate final org.modelmapper.ModelMapperprivate final UidUtilsFields inherited from class com.bytedesk.core.base.BaseRestService
authService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(ChunkEntity chunk) 转换为Excel对象 子类必须实现此方法convertToResponse(ChunkEntity entity) create(ChunkRequest request) protected org.springframework.data.jpa.domain.Specification<ChunkEntity>createSpecification(ChunkRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(ChunkRequest request) voiddeleteAll(ChunkRequest request) voiddeleteByDocList(List<String> docIdList) voiddeleteByUid(String uid) protected ChunkEntitydoSave(ChunkEntity entity) 子类实现具体的保存逻辑enable(ChunkRequest request) protected org.springframework.data.domain.Page<ChunkEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<ChunkEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现findByKbUid(String kbUid) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ChunkEntity entity) voidupdate(ChunkRequest 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
-
chunkRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
kbaseRestService
-
fileRestService
-
bytedeskEventPublisher
-
-
Constructor Details
-
ChunkRestService
public ChunkRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<ChunkEntity> createSpecification(ChunkRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<ChunkEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<ChunkEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
findByUid
@Cacheable(value="chunk", key="#uid", unless="#result==null") public Optional<ChunkEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
findByKbUid
@Cacheable(value="chunk", key="#kbUid", unless="#result==null") public List<ChunkEntity> findByKbUid(String kbUid) -
create
- Specified by:
createin classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
update
- Specified by:
updatein classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
handleOptimisticLockingFailureException
public ChunkEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, ChunkEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
deleteByDocList
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
delete
- Specified by:
deletein classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
deleteAll
-
enable
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<ChunkEntity,ChunkRequest, ChunkResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<ChunkEntity,ChunkRequest, ChunkResponse, ChunkExcel>
-
initChunk
-