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 AssistantRepository
private final AuthService
private final org.modelmapper.ModelMapper
private 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的通用实现void
delete
(AssistantRequest request) void
deleteByUid
(String uid) protected AssistantEntity
doSave
(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:
createSpecification
in 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:
executePageQuery
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
findByUid
- Specified by:
findByUid
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
existsByUid
-
create
- Specified by:
create
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
update
- Specified by:
update
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
doSave
Description copied from class:BaseRestService
子类实现具体的保存逻辑- Specified by:
doSave
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
deleteByUid
- Specified by:
deleteByUid
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
delete
- Specified by:
delete
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
handleOptimisticLockingFailureException
public AssistantEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AssistantEntity entity) - Specified by:
handleOptimisticLockingFailureException
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-
convertToResponse
- Specified by:
convertToResponse
in classBaseRestService<AssistantEntity,
AssistantRequest, AssistantResponse>
-