Package com.bytedesk.kbase.quick_reply
Class QuickReplyRestService
java.lang.Object
com.bytedesk.core.base.BaseRestService<T,TRequest,TResponse>
com.bytedesk.core.base.BaseRestServiceWithExport<QuickReplyEntity,QuickReplyRequest,QuickReplyResponse,QuickReplyExcel>
com.bytedesk.kbase.quick_reply.QuickReplyRestService
@Service
public class QuickReplyRestService
extends BaseRestServiceWithExport<QuickReplyEntity,QuickReplyRequest,QuickReplyResponse,QuickReplyExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CategoryRestServiceprivate final org.modelmapper.ModelMapperprivate final QuickReplyRepositoryprivate final UidUtilsFields inherited from class com.bytedesk.core.base.BaseRestService
authService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertExcelToQuickReply(QuickReplyExcel excel, String kbUid, String orgUid) convertToExcel(QuickReplyEntity quickReply) 转换为Excel对象 子类必须实现此方法convertToResponse(QuickReplyEntity entity) create(QuickReplyRequest request) protected org.springframework.data.jpa.domain.Specification<QuickReplyEntity>createSpecification(QuickReplyRequest request) 创建Specification对象,子类必须实现 用于queryByOrg的通用实现voiddelete(QuickReplyRequest entity) voiddeleteByUid(String uid) protected QuickReplyEntitydoSave(QuickReplyEntity entity) 子类实现具体的保存逻辑enable(QuickReplyRequest request) protected org.springframework.data.domain.Page<QuickReplyEntity>executePageQuery(org.springframework.data.jpa.domain.Specification<QuickReplyEntity> spec, org.springframework.data.domain.Pageable pageable) 执行分页查询,子类必须实现 用于queryByOrg的通用实现handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, QuickReplyEntity entity) voidinitQuickReply(String orgUid) voidinitQuickReplyCategory(String orgUid) voidsave(List<QuickReplyEntity> entities) update(QuickReplyRequest 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
-
quickReplyRepository
-
modelMapper
private final org.modelmapper.ModelMapper modelMapper -
uidUtils
-
categoryRestService
-
-
Constructor Details
-
QuickReplyRestService
public QuickReplyRestService()
-
-
Method Details
-
createSpecification
protected org.springframework.data.jpa.domain.Specification<QuickReplyEntity> createSpecification(QuickReplyRequest request) Description copied from class:BaseRestService创建Specification对象,子类必须实现 用于queryByOrg的通用实现- Specified by:
createSpecificationin classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
executePageQuery
protected org.springframework.data.domain.Page<QuickReplyEntity> executePageQuery(org.springframework.data.jpa.domain.Specification<QuickReplyEntity> spec, org.springframework.data.domain.Pageable pageable) Description copied from class:BaseRestService执行分页查询,子类必须实现 用于queryByOrg的通用实现- Specified by:
executePageQueryin classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
findByUid
@Cacheable(value="quickreply", key="#uid", unless="#result == null") public Optional<QuickReplyEntity> findByUid(String uid) - Specified by:
findByUidin classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
create
- Specified by:
createin classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
update
- Specified by:
updatein classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
doSave
@CachePut(value="quickreply", key="#entity.uid") protected QuickReplyEntity doSave(QuickReplyEntity entity) Description copied from class:BaseRestService子类实现具体的保存逻辑- Specified by:
doSavein classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
handleOptimisticLockingFailureException
public QuickReplyEntity handleOptimisticLockingFailureException(org.springframework.orm.ObjectOptimisticLockingFailureException e, QuickReplyEntity entity) - Specified by:
handleOptimisticLockingFailureExceptionin classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
save
-
enable
-
deleteByUid
- Specified by:
deleteByUidin classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
delete
- Specified by:
deletein classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
convertToResponse
- Specified by:
convertToResponsein classBaseRestService<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse>
-
convertToExcel
Description copied from class:BaseRestServiceWithExport转换为Excel对象 子类必须实现此方法- Specified by:
convertToExcelin classBaseRestServiceWithExport<QuickReplyEntity,QuickReplyRequest, QuickReplyResponse, QuickReplyExcel>
-
initQuickReplyCategory
-
initQuickReply
-
convertExcelToQuickReply
public QuickReplyEntity convertExcelToQuickReply(QuickReplyExcel excel, String kbUid, String orgUid)
-