Package com.bytedesk.core.assistant
Class AssistantRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<AssistantEntity,AssistantRequest,AssistantResponse>
com.bytedesk.core.assistant.AssistantRestService
@Service
public class AssistantRestService
extends BaseRestService<AssistantEntity,AssistantRequest,AssistantResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AssistantRepositoryprivate final AuthServiceprivate final org.modelmapper.ModelMapperprivate final UidUtils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToResponse(AssistantEntity assistant) create(AssistantRequest request) protected org.springframework.data.jpa.domain.Specification<AssistantEntity>createSpecification(AssistantRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(AssistantRequest request) voiddeleteByUid(String uid) protected AssistantEntitydoSave(AssistantEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<AssistantEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<AssistantEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AssistantEntity entity) update(AssistantRequest request) Methods inherited from class com.bytedesk.core.base.BaseRestService
deleteByOrgUid, findByOrgUid, getUidFromRequest, queryByOrg, queryByUid, queryByUser, recover, save, setUserUidToRequest
-
Field Details
-
assistantRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
AssistantRestService
public AssistantRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<AssistantEntity> createSpecification(AssistantRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<AssistantEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<AssistantEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
findByUid
- Specified by:
findByUidin classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
existsByUid
-
create
- Specified by:
createin classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
update
- Specified by:
updatein classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
delete
- Specified by:
deletein classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
handleOptimisticLockingFailureException
public AssistantEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AssistantEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<AssistantEntity,AssistantRequest, AssistantResponse>
-