Class AgentTemplateRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<AgentTemplateEntity,AgentTemplateRequest,AgentTemplateResponse,AgentTemplateExcel>
com.bytedesk.service.agent_template.AgentTemplateRestService
@Service
public class AgentTemplateRestService
extends BaseRestServiceWithExport<AgentTemplateEntity,AgentTemplateRequest,AgentTemplateResponse,AgentTemplateExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AgentTemplateRepositoryprivate final AuthServiceprivate final org.modelmapper.ModelMapperprivate final UidUtils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToExcel(AgentTemplateEntity entity) 转换为Excel对象 子类必须实现此方法convertToResponse(AgentTemplateEntity entity) create(AgentTemplateRequest request) protected org.springframework.data.jpa.domain.Specification<AgentTemplateEntity>createSpecification(AgentTemplateRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(AgentTemplateRequest request) voiddeleteByUid(String uid) protected AgentTemplateEntitydoSave(AgentTemplateEntity entity) 子类实现具体的保存逻辑protected org.springframework.data.domain.Page<AgentTemplateEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<AgentTemplateEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现existsByUid(String uid) findByNameAndOrgUidAndType(String name, String orgUid, String type) handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AgentTemplateEntity entity) voidinitAgentTemplates(String orgUid) update(AgentTemplateRequest 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
-
agentTemplateRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
authService
-
-
Constructor Details
-
AgentTemplateRestService
public AgentTemplateRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<AgentTemplateEntity> createSpecification(AgentTemplateRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<AgentTemplateEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<AgentTemplateEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
findByUid
@Cacheable(value="agentTemplate", key="#uid", unless="#result==null") public Optional<AgentTemplateEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
findByNameAndOrgUidAndType
@Cacheable(value="agentTemplate", key="#name + \'_\' + #orgUid + \'_\' + #type", unless="#result==null") public Optional<AgentTemplateEntity> findByNameAndOrgUidAndType(String name, String orgUid, String type) -
existsByUid
-
create
- Specified by:
createin classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
update
- Specified by:
updatein classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
doSave
Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
handleOptimisticLockingFailureException
public AgentTemplateEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, AgentTemplateEntity entity) -
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
delete
- Specified by:
deletein classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<AgentTemplateEntity,AgentTemplateRequest, AgentTemplateResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法 -
initAgentTemplates
-